comp.lang.ada
 help / color / mirror / Atom feed
* string and wide string usage
@ 2013-03-07 11:12 Ali Bendriss
  2013-03-07 14:20 ` ytomino
  2013-03-07 17:48 ` Vadim Godunko
  0 siblings, 2 replies; 7+ messages in thread
From: Ali Bendriss @ 2013-03-07 11:12 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-08  3:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-07 11:12 string and wide string usage Ali Bendriss
2013-03-07 14:20 ` ytomino
2013-03-07 17:14   ` Dmitry A. Kazakov
2013-03-07 23:53   ` Randy Brukardt
2013-03-08  2:05     ` Yannick Duchêne (Hibou57)
2013-03-08  3:07       ` Randy Brukardt
2013-03-07 17:48 ` Vadim Godunko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox