![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| ||||||||
| ||||||||
|
|
cd $II_SYSTEM/ingres/files/collation cat pm_col.dsc a:á |
|
aducompile pm_col.dsc pm_col createdb collatedb -lpm_col Creating database 'collatedb' . . . |
|
sql collatedb < test.sql | cat INGRES TERMINAL MONITOR Copyright 2011 Actian Corporation |
|
col1 |col2 | +-------------+--------------------+ 1|Cháteau | 2|Château | 3|Chãteau | 4|Chäteau | 5|Chateau | +-------------+--------------------+ |
|
col1 |col2 | +-------------+--------------------+ 1|Cháteau | 2|Château | 3|Chãteau | 4|Chäteau | 5|Chateau | 7|abc | +-------------+--------------------+ |
|
col1 |col2 | +-------------+--------------------+ 5|Chateau | 4|Chäteau | 1|Cháteau | 3|Chãteau | 2|Château | 7|abc | 6|xyz | +-------------+--------------------+ |
|
col2 | +--------------------+ Cháteau | abc | xyz | +--------------------+ |
|
-----Original Message----- From: info-ingres-bounces (AT) kettleriver...ting (DOT) com [mailto:info- ingres-bounces (AT) kettleriverconsulting (DOT) com] On Behalf Of Ingres Forums Sent: 12 October 2011 08:03 To: info-ingres (AT) kettleriverconsulting (DOT) com Subject: [Info-Ingres] Select, escaping special chars Hello everyone ![]() I have to use an Ingres Database to store my data which is in several languages (like french, german, and so on). In my web site, the user can use the function "search". The problem are the special characters like éÃ*èâ in french, or öäü in german. The user doesn't enter these characters, but it should be found anyway. For example: In the database is the word "château". The user types "chateau" (whithout â) The program should find the "château", even if "chateau" was typed. So all accents in the database should be replaced by something more useful (like "_") Has someone an idea how to do that? Ingres database version : 9.2.1 Thanks a lot, Kakmael -- Kakmael ----------------------------------------------------------------------- - Kakmael's Profile: http://community.actian.com/forum/me...?userid=111714 View this thread: http://community.actian.com/forum/sh...ad.php?t=13988 |
#22
| |||
| |||
|
|
Convert records to ascii using iconv. Convert search criteria to ascii using iconv. Then search. Then map the results back to original and display. |
#23
| |||
| |||
|
#24
| |||
| |||
|
#25
| |||
| |||
|
|
On Oct 18, 3:53*pm, seldomisnice... (AT) gmail (DOT) com wrote: Convert records to ascii using iconv. Convert search criteria to ascii using iconv. Then search. Then map the results back to original and display. Do you have an example of how to do this? I'm wasn't aware iconv could do that. Here is a demo that shows some problems, I'd be interested in any extra options iconv has that could help: $ python -c 'mystr = u"Bj\N{LATIN SMALL LETTER O WITH DIAERESIS} rk";print mystr.encode("utf8")' | iconv --from-code utf8 --to-code us- ascii Bjiconv: illegal input sequence at position 2 $ python -c 'mystr = u"Bj\N{LATIN SMALL LETTER O WITH DIAERESIS} rk";print mystr.encode("utf8")' | iconv --from-code utf8 --to-code us- ascii -c Bjrk $ The later one appear to work but note that it is missing a character! |
#26
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |