d0n Posted December 3, 2009 Share Posted December 3, 2009 (edited) I have a sqlite database with some chinese characters in it However when i import that into a GUIListview it turns into garbage I tried using this but nothing happened _GUICtrlListView_SetUnicodeFormat($ListView1, True) Edited December 3, 2009 by d0n Link to comment Share on other sites More sharing options...
BrettF Posted December 4, 2009 Share Posted December 4, 2009 What sort of garbage? Is the SQLite database able to handle unicode? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
d0n Posted December 4, 2009 Author Share Posted December 4, 2009 yea it works fine in when i open the .db with SQLite expert, but when i load the data into a listview it turns into garbage æ–°èž this type of garbage, kinda changed a bit when i copied from listview into here Link to comment Share on other sites More sharing options...
BrettF Posted December 4, 2009 Share Posted December 4, 2009 Version of AutoIt? There was something with unicode but I can't remember it. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
d0n Posted December 4, 2009 Author Share Posted December 4, 2009 v3.3.0.0 from the help file Link to comment Share on other sites More sharing options...
jdefockert Posted December 4, 2009 Share Posted December 4, 2009 Hi, I have a similar problem but with German. In the SQLite DB the string look like this: "Hinzufügen", but when I retrieve the string with the function _SQLite_QuerySingleRow it comes up as "Hinzufügen". The double byte character "ü" has been replaced with 2 garbage characters. Any help or ideas would be greatly appreciated. Kind regards, Jasper Link to comment Share on other sites More sharing options...
d0n Posted December 5, 2009 Author Share Posted December 5, 2009 anyone help? Link to comment Share on other sites More sharing options...
ProgAndy Posted December 5, 2009 Share Posted December 5, 2009 (edited) I think, SQLite saves the data as UTF-8, but the functions return it as ANSI. So try this: First get the bytes from the string and then reinterpret them as UTF8 $sUTF8 = BinaryToString(StringToBinary($sString, 1), 4) Edited December 5, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
d0n Posted December 5, 2009 Author Share Posted December 5, 2009 Hi, that worked for the reading part. Reading the SQLite database for unicode and inserting them into the Listview. I was wondering how it will work if i want to write some data as unicode, i tried playing around with the code you posted, but i couldn't get it to show the unicode. $Input = InputBox("Modify", "Enter new", "", "", 250, 50) ;add the new unicode data into SQLite Link to comment Share on other sites More sharing options...
KaFu Posted December 5, 2009 Share Posted December 5, 2009 With something like this: $UnicodeString = "ελληνική γλώσσα" _SQLite_Exec (-1, "INSERT INTO aTest(a,b,c) VALUES ('c'," & BinaryToString(StringToBinary($UnicodeString , 4), 1) & ",'World');") ; INSERT Data OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
d0n Posted December 5, 2009 Author Share Posted December 5, 2009 got it working, Thanks for helping everyone! Link to comment Share on other sites More sharing options...
jchd Posted December 20, 2009 Share Posted December 20, 2009 got it working, Thanks for helping everyone!Hi,This is no more a problem with the latest SQLite UDF, which handles native AutoIt Unicode strings nicely without requiring anything else. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
DerMedizinmann Posted December 28, 2009 Share Posted December 28, 2009 $sUTF8 = BinaryToString(StringToBinary($sString, 1), 4) ... Yeahh! Thank you very much, Andy. This helps me a great deal! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now