Thread: Encoding
I've been trying to search the archives but can't seem to find the right answers anywhere. I'm building a database containing ranges of characters. That means i'm supposed to check if t.ex. 'Sveen' is between 'Sv' and 'R'. This works ok for non norwegian characters, but when these show up the results are wrong. (æ ø å if anyone can see them) Been experimenting with Encoding settings when creating a database but can't seem to get this right. Been trying LATIN1 through LATIN5. Are there any other encodings? Am i looking in the right place? Using redhat 6.2 and 7.0.3-1 rpms. Thanks, Anders,
It also seems that when using manual configure and make instead of RPM's, this error does NOT occur. How come? Anders,
"Anders R. Sveen" <anderssv@stud.ntnu.no> writes: > I'm building a database containing ranges of characters. That means i'm > supposed to check if t.ex. 'Sveen' is between 'Sv' and 'R'. This works ok > for non norwegian characters, but when these show up the results are > wrong. (� � � if anyone can see them) Offhand I think you need a suitable LOCALE setting, not an encoding. The encoding stuff is for multibyte character sets --- which is mostly Asian languages, not European. For Norwegian you don't need 16-bit characters, you just need to set the collation order of 8-bit chars. BTW: one thing to beware of when using LOCALE is that you've gotta be careful to start the postmaster with the same LOCALE environment variables every time for a given database. Otherwise, the LOCALE-dependent sort order of your indexes gets messed up, and things start to behave very strangely ... regards, tom lane
Tom Lane <tgl@sss.pgh.pa.us> writes: > BTW: one thing to beware of when using LOCALE is that you've gotta be > careful to start the postmaster with the same LOCALE environment > variables every time for a given database. Otherwise, the > LOCALE-dependent sort order of your indexes gets messed up, and things > start to behave very strangely ... > And you have to reindex the relevant tables to get things working properly again. I did this two months ago to get the right sort order for norwegian letters(ISO-8859-1 character encoding). Works like I a charm now on Solaris, but I still have a problem on my Linux development machine - believe this a Linux libc config problem and not related to Postgres as it works fine on Solaris. regards, Gunnar