From latin9 to sql_ascii??

Started by Jaime Casanovaalmost 22 years ago11 messagespatches
Jump to latest
#1Jaime Casanova
jcasanov@systemguards.com.ec

Hi,

someone show me that if had accents in a word i can
suppress it with the to_ascii function.

=> select to_ascii('Jim�nez');

will retrieve 'Jimenez' at least it works on Latin1
encoding.

Why it not work on Latin9, there's another way of
doing such a thing?

regards,
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Informaci�n de Estados Unidos y Am�rica Latina, en Yahoo! Noticias.
Vis�tanos en http://noticias.espanol.yahoo.com

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jaime Casanova (#1)
Re: From latin9 to sql_ascii??

Jaime Casanova <systemguards@yahoo.com> writes:

=> select to_ascii('Jim�nez');
will retrieve 'Jimenez' at least it works on Latin1
encoding.

Why it not work on Latin9,

Probably because it hasn't got a table for Latin9. Feel free to
contribute one --- see src/backend/utils/adt/ascii.c.

regards, tom lane

#3Jaime Casanova
jcasanov@systemguards.com.ec
In reply to: Tom Lane (#2)
Re: From latin9 to sql_ascii??
 --- Tom Lane <tgl@sss.pgh.pa.us> escribi�: 

Jaime Casanova <systemguards@yahoo.com> writes:

=> select to_ascii('Jim�nez');
will retrieve 'Jimenez' at least it works on

Latin1

encoding.

Why it not work on Latin9,

Probably because it hasn't got a table for Latin9.
Feel free to
contribute one --- see
src/backend/utils/adt/ascii.c.

I will be pleased of, if i can understand this.
Can you tell me where i can found info about this
issue?

regards,
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Informaci�n de Estados Unidos y Am�rica Latina, en Yahoo! Noticias.
Vis�tanos en http://noticias.espanol.yahoo.com

#4Jaime Casanova
jcasanov@systemguards.com.ec
In reply to: Jaime Casanova (#3)
Re: From latin9 to sql_ascii??
 --- Jaime Casanova <systemguards@yahoo.com> escribi�:
--- Tom Lane <tgl@sss.pgh.pa.us> escribi�: 

Jaime Casanova <systemguards@yahoo.com> writes:

=> select to_ascii('Jim�nez');
will retrieve 'Jimenez' at least it works on
Latin1 encoding.

Why it not work on Latin9,

Probably because it hasn't got a table for Latin9.

Feel free to contribute one --- see
src/backend/utils/adt/ascii.c.

This page shows the differences between Latin1 &
Latin9:
http://www.cs.tut.fi/~jkorpela/latin9.html

The diffs are:

164: the euro symbol. (sql_ascii = 'E')???
166: an S with a symbol above (sql_ascii = 'S')
168: the same but lower case (sql_ascii = 's')
180: an Z with a symbol above (sql_ascii = 'Z')
184: the same but lower case (sql_ascii = 'z')
188: it's an O merge with an E (sql_ascii = '')???
189: the same but lower case (sql_ascii = '')???
190: an Y with a 2 points above (sql_ascii = 'Y')

Comments?

regards,
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Informaci�n de Estados Unidos y Am�rica Latina, en Yahoo! Noticias.
Vis�tanos en http://noticias.espanol.yahoo.com

Attachments:

ascii.patchapplication/octet-stream; name=ascii.patchDownload+8-0
#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jaime Casanova (#4)
Re: From latin9 to sql_ascii??

Jaime Casanova <systemguards@yahoo.com> writes:

Why it not work on Latin9,

Probably because it hasn't got a table for Latin9.

Feel free to contribute one --- see
src/backend/utils/adt/ascii.c.

This page shows the differences between Latin1 &
Latin9:
http://www.cs.tut.fi/~jkorpela/latin9.html

The diffs are:

164: the euro symbol. (sql_ascii = 'E')???
166: an S with a symbol above (sql_ascii = 'S')
168: the same but lower case (sql_ascii = 's')
180: an Z with a symbol above (sql_ascii = 'Z')
184: the same but lower case (sql_ascii = 'z')
188: it's an O merge with an E (sql_ascii = '')???
189: the same but lower case (sql_ascii = '')???
190: an Y with a 2 points above (sql_ascii = 'Y')

Comments?

Works for me. Anyone feel this is too big a change to push into 8.0?
Strictly speaking it's a new feature, but it sure looks harmless from
here.

Personally I'd say that the euro symbol should map to ' ' not 'E',
but am not set on that.

regards, tom lane

#6Peter Eisentraut
peter_e@gmx.net
In reply to: Jaime Casanova (#4)
Re: From latin9 to sql_ascii??

Jaime Casanova wrote:

188: it's an O merge with an E (sql_ascii = '')???
189: the same but lower case (sql_ascii = '')???

'OE' and 'oe', most likely, but someone more familiar with French
typography might correct me.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#7Jaime Casanova
jcasanov@systemguards.com.ec
In reply to: Peter Eisentraut (#6)
Re: From latin9 to sql_ascii??
 --- Peter Eisentraut <peter_e@gmx.net> escribi�: 

Jaime Casanova wrote:

188: it's an O merge with an E (sql_ascii =

'')???

189: the same but lower case (sql_ascii =

'')???

'OE' and 'oe', most likely, but someone more
familiar with French
typography might correct me.

Something like that, i really doesn't know how to
convert to sql_ascii that.

Maybe just blank like Tom suggest about the euro
symbol

regards,
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Informaci�n de Estados Unidos y Am�rica Latina, en Yahoo! Noticias.
Vis�tanos en http://noticias.espanol.yahoo.com

#8Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Peter Eisentraut (#6)
Re: From latin9 to sql_ascii??

On Fri, Dec 17, 2004 at 11:09:17PM +0100, Peter Eisentraut wrote:

Jaime Casanova wrote:

188: it's an O merge with an E (sql_ascii = '')???
189: the same but lower case (sql_ascii = '')???

'OE' and 'oe', most likely, but someone more familiar with French
typography might correct me.

OE and oe would be correct, but we can't do that with the current code.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
Thou shalt check the array bounds of all strings (indeed, all arrays), for
surely where thou typest "foo" someone someday shall type
"supercalifragilisticexpialidocious" (5th Commandment for C programmers)

#9Jaime Casanova
jcasanov@systemguards.com.ec
In reply to: Tom Lane (#5)
Re: From latin9 to sql_ascii??
 --- Tom Lane <tgl@sss.pgh.pa.us> escribi�: 

Jaime Casanova <systemguards@yahoo.com> writes:

Why it not work on Latin9,

Probably because it hasn't got a table for

Latin9.

Feel free to contribute one --- see
src/backend/utils/adt/ascii.c.

This page shows the differences between Latin1 &
Latin9:
http://www.cs.tut.fi/~jkorpela/latin9.html

The diffs are:

164: the euro symbol. (sql_ascii =

'E')???

166: an S with a symbol above (sql_ascii = 'S')
168: the same but lower case (sql_ascii = 's')
180: an Z with a symbol above (sql_ascii = 'Z')
184: the same but lower case (sql_ascii = 'z')
188: it's an O merge with an E (sql_ascii =

'')???

189: the same but lower case (sql_ascii =

'')???

190: an Y with a 2 points above (sql_ascii = 'Y')

Comments?

Works for me. Anyone feel this is too big a change
to push into 8.0?
Strictly speaking it's a new feature, but it sure
looks harmless from here.

You guys have the code, you guys have the power.
I don't think it can cause any problem. :)

Personally I'd say that the euro symbol should map
to ' ' not 'E', but am not set on that.

Maybe, someone that uses the euro symbol can comment??
if not, and you said that we can just map that symbol
to ' '.

Here's the *fixed* patch it's up to you wich one to
use.

regards,
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Informaci�n de Estados Unidos y Am�rica Latina, en Yahoo! Noticias.
Vis�tanos en http://noticias.espanol.yahoo.com

Attachments:

ascii2.patchtext/plain; name=ascii2.patchDownload+8-0
#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#8)
Re: From latin9 to sql_ascii??

Alvaro Herrera <alvherre@dcc.uchile.cl> writes:

On Fri, Dec 17, 2004 at 11:09:17PM +0100, Peter Eisentraut wrote:

'OE' and 'oe', most likely, but someone more familiar with French
typography might correct me.

OE and oe would be correct, but we can't do that with the current code.

More to the point, there are no such characters in 7-bit ASCII.

I think Alvaro might be suggesting that to_ascii() should expand these
to the two-character sequences "OE" and "oe", but ISTM that opens a can
of worms better left sealed. There are a *lot* of characters that have
translations of differing levels of plausibility into ASCII. I'm okay
with dropping accent marks but I'm not sure about doing more than that.

regards, tom lane

#11Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jaime Casanova (#9)
Re: From latin9 to sql_ascii??

Jaime Casanova <systemguards@yahoo.com> writes:

Here's the *fixed* patch it's up to you wich one to
use.

I applied this one.

regards, tom lane