Rodger Posted March 6, 2010 Share Posted March 6, 2010 (edited) Hello, When I query directly on the Sqlite3 database, these characters are shown correctly, but when I show them in AutoIt by using the same query, these characters are changed to ?. Does anybody know how to fix this? Thnx Rodger Edited March 6, 2010 by Rodger Link to comment Share on other sites More sharing options...
KaFu Posted March 6, 2010 Share Posted March 6, 2010 Use SciTE as your script editor and then change encoding of the script: File => Encoding => UTF-8. 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...
jchd Posted March 6, 2010 Share Posted March 6, 2010 Also of prime importance: be sure to use a recent version of AutoIt. The current beta gives excellent results and you can use it + SQLite with confidence. If ever you select to use a separate sqlite3.dll file be certain to use 3.6.22 (latest release available). Now if you have to perform string manipulations on your non-ASCII data (characters > 0x7F), you'll find that SQLite offers no support by itself. At this moment, you may choose to use ICU (the large, slow, perfect library) or a more lightweight extension that I can provide to you. Tell me if you want to know more about it. 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...
Rodger Posted March 6, 2010 Author Share Posted March 6, 2010 Also of prime importance: be sure to use a recent version of AutoIt. The current beta gives excellent results and you can use it + SQLite with confidence. If ever you select to use a separate sqlite3.dll file be certain to use 3.6.22 (latest release available).Now if you have to perform string manipulations on your non-ASCII data (characters > 0x7F), you'll find that SQLite offers no support by itself. At this moment, you may choose to use ICU (the large, slow, perfect library) or a more lightweight extension that I can provide to you. Tell me if you want to know more about it.Changing the encoding didn't work. If you can tell me something about ICU or your lightweight extension I would appreciate it..... Especially I like to know how to implement it in AutoIt..... Link to comment Share on other sites More sharing options...
jchd Posted March 6, 2010 Share Posted March 6, 2010 No problem. You can learn a lot about ICU on its website. It's a very big, very complete solution for internationalization with ample documentation. There's little I could add of my own about it, lest paraphrasing.SQLite has "pre-built-in" support for ICU, but using ICU comes at a price. ICU is a large library (16..18 Mb) and is slow because it does everything close to perfectly. One other thing that I didn't like too much with ICU is that you need to define a locale to create a collation. For instance, being myself French, I would be tempted to use the fr-FR locale. ICU handles about every locale combination possible with great respect. But when applied to a column holding, say, individual customers names from now 21 countries, which "locale" should I use? In fact the concept itself doesn't make real sense applied to a database holding worldwide data. (FYI, my wife and I run a _small_ e-shop, but we nonetheless sell worldwide and have data from suppliers in various countries as well.) Finally, using locale for defining collation introduces an untold metadata in the database as soon as you use it to index a column. Your index are valid as long as you're using the same library with the same locale, but that doesn't make any sense if the database can be used by several people worldwide, each of them prefering his/her own locale. You just understood that I regard locales just like threads: evil.After unconclusive tries, I decided to write an homebrew SQLite extension which I called Unifuzz. It handles Unicode string "mostly correctly" and includes a fuzzy unaccented string compare. I made the library "locale-independant" for string oprerations as well as for collation. Purists whine and object that locale-independant collation is impossible, and that's the Truth. I'd say it's close enough to very decent behavior for "most" pratical purposes in all languages where people tried it.To successfully use SQLite with AutoIt, you don't have too much to do. As mentionned earlier, be sure to always use the UTF-8 + BOM format for your sources. Now the problem of display is: how do you display the result of your queries? Be aware that _SQLiteDisplayTable uses the console and it isn't Unicode-aware: everything displayed there is hashed into ANSI using user locale and that may give less than pretty results. You can use _ArrayDisplay provided the default font it uses covers the Unicode ranges you're displaying. I personnally like fixed-pitch fonts for programming and I use DejaVu Sans Mono with good success: very readable, unambiguoused glyphs decent Unicode coverage, free.An SQLite extension is really easy to use. I'm preparing a post about this in the Example code forum. I'll post Unifuzz there, of course in both source and binary form.So don't fear to be left alone and stay tuned. 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...
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