Reading German Umlauts correct

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading German Umlauts correct

dannyp1202
Hello :)
 
I'm reading Information from a SQLite database. But this Information
contains German umlauts like ä, ö, ü. When I get these Information back in
my Programm, these umlauts are unreadable. The ü for example is ü. The
umlauts are stored in the Database correctly.
 
Can somebody tell me, what I have to do, that the umlauts are displayes
correctly exept a string manipulation after data-reading?
 
Thanks in advance :)
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Reading German Umlauts correct

Ralf Junker
SQLite stores text as UTF-8 - this is the default and it can be changed to UTF16, but you would probably encounter similar problems.

"ü" is the UTF-8 representation of "ü" - to retrieve and display the German Umlaut you must decode the UTF-8 encoded text to its Unicode representation. For more on Unicode and UTF-8, see http://www.unicode.org.

I have written a SQLite database explorer named SQLiteSpy which displays UTF-8 encoded SQLite databases including German Umlauts. SQLiteSpy is available for free from

  http://www.yunqa.de/delphi/sqlitespy/

You can also uses SQLiteSpy to enter Umlauts as SQL and they will be automatically encoded as appropriate (UTF-8 or UTF-16) and stored in your database.

Regards,

Ralf

>I'm reading Information from a SQLite database. But this Information
>contains German umlauts like ä, ö, ü. When I get these Information back in
>my Programm, these umlauts are unreadable. The ü for example is ü. The
>umlauts are stored in the Database correctly.
>
>Can somebody tell me, what I have to do, that the umlauts are displayes
>correctly exept a string manipulation after data-reading?

Reply | Threaded
Open this post in threaded view
|

Re: Reading German Umlauts correct

Helmut Tschemernjak
In reply to this post by dannyp1202
Hallo Daniel,

on Windows you can use WideCharToMultiByte and MultibyteToWideChar to
convert from and to UTF8. I would recommend to use utf8 in the DB
because it is a pretty good standard and being using in Mac OS X, Java,
Solaris/Linux, HTML, and others. Windows uses either 8 bit client
charset e.g. PC850 or 16 bit Unicode. UTF-8 is basically the same like
16 bit Unicode but encoded into 8 bit where basic chars 0-127 stay in
ascii.


Helmut Tschemernjak


[hidden email] wrote:

> Hello :)
>  
> I'm reading Information from a SQLite database. But this Information
> contains German umlauts like ?, ?, ?. When I get these Information back in
> my Programm, these umlauts are unreadable. The ? for example is ü. The
> umlauts are stored in the Database correctly.
>  
> Can somebody tell me, what I have to do, that the umlauts are displayes
> correctly exept a string manipulation after data-reading?
>  
> Thanks in advance :)
> Daniel
>