SQLite and Umlaut

BlitzMax Forums/BlitzMax Beginners Area/SQLite and Umlaut

René(Posted 2006) [#1]
Hi,

has somebpdy managed to read special chars like german umlaute from SQLite database with teamonkey's wrapper?

When I view the db file with SQLite Browser the umlaute are displayed correct. But when I read them with the wrapper they are displayed like this: "Ão" for an "Ü" i.e.


FlameDuck(Posted 2006) [#2]
I'm guessing Teamonkeys wrapper isn't handling Unicode characters very elegantly.

So stop using non-latin letters. :o>


assari(Posted 2006) [#3]
Rene,
I don't think its the wrapper. The BlitzMax print function is not handling the european characters.
See this thread: http://www.blitzmax.com/Community/posts.php?topic=59697
See the output from this code
Graphics 800,600,0
Local font:TImageFont=LoadImageFont("C:\WINDOWS\Fonts\arial.ttf",12)
SetImageFont(font)
SetColor 255,255,255
DrawText "chr(220)="+Chr(220), 10, 10
Flip
WaitKey()
Print "chr(220)="+Chr(220)
End



René(Posted 2006) [#4]
Thanks for you answers. I made some test and found out:
this is strange to me.

When I convert a umlaut in a BMax String (i.e. Ü -> Ão) and write this string into a SQLite field, SQLite Browser displays the umlaut correct.

If I want to read this field again and display correct in BMax, I have to re-convert the umlaut again (i.e. Ão -> Ü).

This has been the only way in "pre BMax 1.18" to work with umlauts in SQLite and BMax (at last I think).

Now with 1.18+ you don't need to convert any umlauts. Writing and reading is fine with BMax. I tested MaxGUI and DebugLog (Print in console does not display the umlauts! Where is the difference between DebugLog and Print?).

But: now the umlauts in SQL Browser display as boxes.
So two apps, being able to display standard ASCII symbols, but treating them different? Why?


FlameDuck(Posted 2006) [#5]
Because the umlaut U is not a standard ASCII symbol. American Standard Code for Information Interchange, being American in nature is oblivious to German special characters.


René(Posted 2006) [#6]
As far as I know german umlauts are encoded in 8bit ASCII. But the umlauts were not encoded in original 7bit ASCII. I don't know what ASCII BlitzMax is using.

Maybe the problem is, that BlitzMax uses unicode only since 1.18 and SQLite Browser uses a form of 8bit ASCII.

Anyway, it works now :-)


Dreamora(Posted 2006) [#7]
BM used 8bit Ascii, but BM default font is US characters only which makes umlaute breaking. (as well as other european special characters)