Page 1 of 1
Help with accented charecters...
Posted: Fri Jun 11, 2010 9:07 am
by Dixie
Good morning...
I have an SQLite database that has some french accented characters in it... When these are pulled into a datagrid in the stack they get replaced with different symbols. Could someone point out to me how to bring them into the datagrid so that they display properly.
Eventually the stack will be running under Windows even though I'm building it on the Mac platform...
Any help would be appreciated... be well
Dixie
MacBook Pro
Mac OS 10.6.3
Re: Help with accented charecters...
Posted: Fri Jun 11, 2010 11:57 am
by Klaus
Hi Dixie,
this is one of the biggest crossplatform problems!
I would stick to ONE character encoding scheme and only use this one on all platforms!
In the past I used the windows iso encoding, so I could use the "mactoiso" and "isotomac" functions
to get and set the text into/out of the database.
I used these little selfmade functions while working:
Code: Select all
function mac2win tText
if the platform = "MacOS" then
return mactoiso(tText)
end if
return tText
end mac2win
function win2mac tText
if the platform= "Win32" then
return tText
end if
return isotomac(tText)
end win2mac
This way I could use:
...
put mac2win(field XYZ) into tVaribale
## write tVaraiable to database
...
## get tect from database
put win2mac(tVariable) into fld xyz
...
You get the picture.
But this might unfortunately not cover ALL accents/special characters!
If you have problems here, you might need to use UNICODE somehow for all of your text.
Best
Klaus
Re: Help with accented charecters...
Posted: Fri Jun 11, 2010 11:54 pm
by Klaus
P.S.
Maybe getting/setting "the htmltext" of fields will also work with accents etc.
Re: Help with accented charecters...
Posted: Sat Jun 12, 2010 6:11 am
by Dixie
Hi Klaus....
Thanks for your replies... I have no problems with accented characters using the htmlText and MySQL databases, it is just that Sqlite does not seem to want to play nicely, no matter what I try...
take care
Dixie
Re: Help with accented charecters...
Posted: Sat Jun 12, 2010 1:26 pm
by Klaus
Hi Dixie,
ah, I see, sorry, looks like I misunderstood your problems.
Hm, no idea why SQLite does not cooperate, since this (htmltext) is just pure ASCII text?