From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,802ccdc10f849020,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.8.4 with SMTP id n4mr6184979wia.0.1362654808887; Thu, 07 Mar 2013 03:13:28 -0800 (PST) Path: bp2ni77727wib.1!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!news.stack.nl!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Ali Bendriss Newsgroups: comp.lang.ada Subject: string and wide string usage Date: Thu, 7 Mar 2013 11:12:01 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Injection-Date: Thu, 7 Mar 2013 11:12:01 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="81f5cfa94c5717db48f115e719a661fb"; logging-data="30308"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OTyZhQRZqOYgaLDW0r/PhsvmBLk6VmeU=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:tCMHbtaFJ7FHdmH9B6G/phn/vBI= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2013-03-07T11:12:01+00:00 List-Id: Hello, I've got a small program that read some value from an ldap server and copy them in a posgres database. the function reading the ldap value return an unbounded_string, then I use to_string to feed postgres (using gnatcoll). I've got some problem with some string in example: a base 64 encoded string V2luZG93c8KgNyBQcm9mZXNzaW9ubmVsIE4= wich decode to 'Windows\xa07 Professionnel N' in utf-8 every thing is working if I feed directly the database, but if want to apply Ada.Characters.Handling.To_Lower on the string before feeding the database postgres is not happy 'ERROR: invalid byte sequence for encoding "UTF8": 0xe2 0xa0 0x37' it's not really a big deal, but I would like to understand where the problem is. Do I have to use wide string ? thanks, Ali