473,788 Members | 2,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems with lower() and unicode-databases


postgres 7.4 on linux, glibc 2.2.4-6

I've a table containing unicode-data and the lower()-function does not
work proper. While it lowers standard letters like A->a,B->b ... it
fails on special letters like german umlauts (Ä , Ö ...) that are simply
keeped untouched.

Everything else (sorting etc.) is working fine and LC_COLLATE, LC_CTYPE
and all the other locales were set proper to 'de_AT.UTF-8' (thats how my
mandrake-systems calls the needed locale. On most other systems its
called 'de_AT.utf8') when doing initdb.

The database-encoding is unicode, but I also tried SQL_ASCII (just to
give it a try) and the same problem.

Whats the problem here?

The following output is copied from a unicode-terminal and copied to the
newsreader. It looks fine here, so I think you can all read it.

# select oid,t,lower(t), length(t) from test order by t;
oid | t | lower | length
-------+-------+-------+--------
17257 | a | a | 1
17268 | A | a | 1
17291 | ä | ä | 1
17265 | Ä | Ä | 1
17269 | B | b | 1
17275 | ñ | ñ | 1
17277 | Ñ | Ñ | 1
17262 | ö | ö | 1
17266 | Ö | Ö | 1
17267 | Ü | Ü | 1
# /usr/local/pgsql/bin/pg_controldata /data/postgresql_de/ | grep LC
LC_COLLATE: de_AT.UTF-8
LC_CTYPE: de_AT.UTF-8

I would be very happy to get a "solution", but a workaround would be
better than nothing ;) perl on the same system can read the data from
the database and lowercase the data without any problems, but this is
too much of a *WORK* *AROUND* :)

thnx a lot,
peter

ps: of course upper does not work as well !!
pps: I looked up the changes on newer postgresql-version, but my topic
did not apperar in the list, so I didnt try new 7.4.5. I think its
merely a problem with setting than with postgreSQL. (at least I hope so ...)
--
mag. peter pilsl
goldfisch.at
IT-management
tel +43 699 1 3574035
fax +43 699 4 3574035
pi***@goldfisch .at

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #1
1 2107
peter pilsl <pi***@goldfisc h.at> writes:
postgres 7.4 on linux, glibc 2.2.4-6 I've a table containing unicode-data and the lower()-function does not
work proper. While it lowers standard letters like A->a,B->b ... it
fails on special letters like german umlauts (Ä , Ö ...) that are simply
keeped untouched.


upper() and lower() didn't support multibyte character sets before 8.0.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
25955
by: Hallvard B Furuseth | last post by:
Has someone got a Python routine or module which converts Unicode strings to lowercase (or uppercase)? What I actually need to do is to compare a number of strings in a case-insensitive manner, so I assume it's simplest to convert to lower/upper first. Possibly all strings will be from the latin-1 character set, so I could convert to 8-bit latin-1, map to lowercase, and convert back, but that seems rather cumbersome.
19
11888
by: Gerson Kurz | last post by:
AAAAAAAARG I hate the way python handles unicode. Here is a nice problem for y'all to enjoy: say you have a variable thats unicode directory = u"c:\temp" Its unicode not because you want it to, but because its for example read from _winreg which returns unicode. You do an os.listdir(directory). Note that all filenames returned are now unicode. (Change introduced I believe in 2.3).
2
2080
by: bobnotbob | last post by:
I have created an application and am trying to call functions from a previously existing dll. I can call some functions fine, but I get a link error an when I try to call any function that takes either an LPCTSTR or wchar_tas a parameter. Here's two functions that cause me problems: void CADAPICALL JuncFunc9(LPCTSTR aaa); void CADAPICALL JuncFunc10( wchar_t * aaa); (CADAPICALL is defined as __declspec(dllexport) or...
0
1363
by: Holger Klawitter | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi there, I have a database with encoding UNICODE, when I run lower() on a column with non ascii code the code for "sharp s" gets garbled. This happens with postgres 7.3. under Linux (Debian woody and SuSE 7.2). I have made sure that LC_CTYPE=C for the server:
18
4635
by: james | last post by:
Hi, I am loading a CSV file ( Comma Seperated Value) into a Richtext box. I have a routine that splits the data up when it hits the "," and then copies the results into a listbox. The data also has some different characters in it that I am trying to remove. The small a with two dots over it and the small y with two dots over it. Here is my code so far to remove the small y: Private Sub Button2_Click(ByVal sender As System.Object, ByVal...
2
1715
by: Ara Anjargolian | last post by:
Just a quick question. Am I mistaken, or was multi-language support for upper(), lower() and friends recently added to 7.5? I could have sworn I saw mention of this on hackers, but, the TODO is not marked as done. Thanks, Ara Anjargolian
4
1731
by: pginfo | last post by:
Hi , I tesetd the lower/upper support and cyrillic and it looks broken. My system: pg 7.4.3 freebsd 5.2.1. I created my database with 'UNICODE'.
3
4237
by: Weiping | last post by:
Hi, while upgrade to 8.0 (beta3) we got some problem: we have a database which encoding is UNICODE, when we do queries like: select upper('ÖÐÎÄ'); --select some multibyte character, then postgresql response: ERROR: invalid multibyte character for locale
2
5771
by: Michael B. Trausch | last post by:
I am having a slight problem with UTF-8 output with Python. I have the following program: x = 0 while x < 0x4000: print u"This is Unicode code point %d (0x%x): %s" % (x, x, unichr(x)) x += 1
4
7872
by: Alexey Moskvin | last post by:
Hi! I have a set of strings (all letters are capitalized) at utf-8, russian language. I need to lower it, but my_string.lower(). Doesn't work. See sample script: # -*- coding: utf-8 -*- s1 = self.title s2 = self.title.lower() print s1 == s2
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.