Sign in to follow this  
Followers 0
Vossen

[SOLVED (kinda)] Charset, _INetGetSource and special characters.

7 posts in this topic

#1 ·  Posted (edited)

Hello fellow AutoIt'ians!

I have run into a problem. I have a webpage encoded in UTF-8, all documents and the database (SQLite). My issue is that I need to print some data out from the webpage to my AutoIt script and it makes funny thing out of my danish characters (æøå) and the ½ character.

The page where I need to get my data from is clicky! Here everything is shown fine and nice as it should.

After having a lil' trip to AutoIt, it looks funny, like this...

CREATE TABLE IF NOT EXISTS 'DishesData' (Id INTEGER PRIMARY KEY, 'Data1' , 'Data2' , 'Data3' , 'Data4' , 'Data5' , 'Data6' , 'Data7' , 'Data8' , 'Data9' );INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', '½ grill kylling');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Afrikansk hakkebøf');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Andelår');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Benløse fugle');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Boller i karry');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Brunkål');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Brændende kærlighed');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Bøflindstrøm');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Culottesteg');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Farsbrød');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Fiskefilet');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Forloren hare');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Frikadeller');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Friskefrikadeller');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Fyldt kylling');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Fyldt rødspætte');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Glaseret hamburgerryg');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Glaseret skinke');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Grillkøller');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Grillspyd');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Græsk farsbrød');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Gullasch');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Hamburgerryg');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Hawaii schnitzel');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Herregårdsbøf');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Hjemmelavet biksemad');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Hvidkålsrulletter');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Hvidløgsmarineret kalkunbryst');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Høns i asparges');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Kalkun gordon bleu');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Kalkungryde');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Kamben');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Kamsteg');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Karbonader');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Karrymarineret svinefillet');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Kartoffelmos');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Koteletter');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Koteletter i fad');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Kylling i karry');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Kyllingebryst');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Kyllingefilet');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Kålruller');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Laksefilet');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Marinerede kam ben');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Marineret kylling');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Marineret svinefilet');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Medister');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Millionbøf');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Mørbradbøf');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Mørbradgryde');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Nakkefilet');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Oksesteg');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Pastaret');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Ribbensteg');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Rullesteg');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Schnitzel');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Shepards pie');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Skinkesteg');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Stegt flæsk');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Svensk pølseret');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Tarteletter');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('main', 'Ålerøget skinke');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', '(oksekød med kartoffelmos)');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'agurkesalat');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'bacon');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'bearnaisesovs');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'blandet salat');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'bløde løg');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'brunsovs');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'champignon');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'cocktail pølser');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'fars');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'flødekartofler');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'flødesovs');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'grøn salat');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'grønsager');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'grønsagssovs');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'gulerødder');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'kalkunkød');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'kartoffelmos');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'kartofler');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'kylling');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'løg');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'paprikasovs');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'persillesovs');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'ris');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'rødbeder');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'røde pølser');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'rødkål');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'salat');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'sovs');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'spejlæg');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'spinatsovs');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'stegte grønsager');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'stuvede grønsager');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'stuvede gulerødder');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'stuvede ærter');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'stuvet hvidkål');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'surt');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'tyttebær');INSERT INTO 'DishesData' (Data1, Data2) VALUES ('adds', 'ærter');

My code looks like this...

#include <GUIConstantsEx.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <GUIListBox.au3>
#include <INet.au3>

Dim $aMain[2][3]
Dim $aConn[6][3]
Dim $aAdds[6][3]

_SQLite_Startup()
_SQLite_Open()

GUICreate("Dishes", 885, 400)

$aMain[1][1] = GUICtrlCreateInput("", 5, 5, 200, 20)
$aMain[1][2] = GUICtrlCreateList("", 5, 30, 200, 300)


$aConn[1][1] = GUICtrlCreateInput("", 210, 5, 25, 20)
$aConn[1][2] = GUICtrlCreateList("", 210, 30, 25, 300)

$aAdds[1][1] = GUICtrlCreateInput("", 240, 5, 100, 20)
$aAdds[1][2] = GUICtrlCreateList("", 240, 30, 100, 300)


$aConn[2][1] = GUICtrlCreateInput("", 345, 5, 25, 20)
$aConn[2][2] = GUICtrlCreateList("", 345, 30, 25, 300)

$aAdds[2][1] = GUICtrlCreateInput("", 375, 5, 100, 20)
$aAdds[2][2] = GUICtrlCreateList("", 375, 30, 100, 300)


$aConn[3][1] = GUICtrlCreateInput("", 480, 5, 25, 20)
$aConn[3][2] = GUICtrlCreateList("", 480, 30, 25, 300)

$aAdds[3][1] = GUICtrlCreateInput("", 510, 5, 100, 20)
$aAdds[3][2] = GUICtrlCreateList("", 510, 30, 100, 300)


$aConn[4][1] = GUICtrlCreateInput("", 615, 5, 25, 20)
$aConn[4][2] = GUICtrlCreateList("", 615, 30, 25, 300)

$aAdds[4][1] = GUICtrlCreateInput("", 645, 5, 100, 20)
$aAdds[4][2] = GUICtrlCreateList("", 645, 30, 100, 300)


$aConn[5][1] = GUICtrlCreateInput("", 750, 5, 25, 20)
$aConn[5][2] = GUICtrlCreateList("", 750, 30, 25, 300)

$aAdds[5][1] = GUICtrlCreateInput("", 780, 5, 100, 20)
$aAdds[5][2] = GUICtrlCreateList("", 780, 30, 100, 300)

GUISetState(@SW_SHOW)

_DatabaseCreate("http://www.shellkorskro.dk/dishesdata/get")

_ConnCreate($aConn, 5, 2)
_MainCreate($aMain, 1, 2)
_AddsCreate($aAdds, 5, 2)

_SQLite_Close()
_SQLite_Shutdown()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _DatabaseCreate($sSource, $hDB = -1)
    $sSQL = _INetGetSource($sSource)
    ClipPut($sSQL)
        MsgBox(0, "", $sSQL)
    _SQLite_Exec($hDB, $sSQL)
EndFunc

Func _ConnCreate($aConn, $iNum, $iLevel)
    For $i = 1 to $iNum
        GUICtrlSetData($aConn[$i][$iLevel], " ")
        GUICtrlSetData($aConn[$i][$iLevel], "med")
        GUICtrlSetData($aConn[$i][$iLevel], ",")
        GUICtrlSetData($aConn[$i][$iLevel], "og")
        _GUICtrlListBox_SelectString($aConn[$i][$iLevel], " ")
    Next
EndFunc

Func _MainCreate($aMain, $iNum, $iLevel, $hDB = -1)
    Local $hQuery, $aRow, $sMsg
    _SQlite_Query ($hDB, "SELECT * FROM DishesData WHERE Data1 = 'main';", $hQuery)
    For $i = 1 to $iNum
        GUICtrlSetData($aMain[$i][$iLevel], " ")
        _GUICtrlListBox_SelectString($aMain[$i][$iLevel], " ")
    Next
    For $i = 1 to $iNum
        While _SQLite_FetchData ($hQuery, $aRow) = $SQLITE_OK
            GUICtrlSetData($aMain[$i][$iLevel], $aRow[2])
        WEnd
    Next
EndFunc

Func _AddsCreate($aAdds, $iNum, $iLevel, $hDB = -1)
    Local $hQuery, $aRow, $sMsg
    _SQlite_Query ($hDB, "SELECT * FROM DishesData WHERE Data1 = 'adds';", $hQuery)
    For $i = 1 to $iNum
        GUICtrlSetData($aAdds[$i][$iLevel], " ")
        _GUICtrlListBox_SelectString($aAdds[$i][$iLevel], " ")
    Next
    While _SQLite_FetchData ($hQuery, $aRow) = $SQLITE_OK
        For $i = 1 to $iNum
            GUICtrlSetData($aAdds[$i][$iLevel], $aRow[2])
        Next
    WEnd
EndFunc

Any genius who can enlighten me, I have been playing around with charsets on my webpage, without luck. I can't really change the charset of the database either as it has to support special characters.

Thanks in advance,

Vossen

Edited by Vossen

Share this post


Link to post
Share on other sites



After crying a bit and going emo. I seem to have fixed it by using this topic while I converted my online page to ANSI and my code now looks like this.

#include <GUIConstantsEx.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <GUIListBox.au3>
#include <INet.au3>

Dim $aMain[2][3]
Dim $aConn[6][3]
Dim $aAdds[6][3]

_SQLite_Startup()
_SQLite_Open()

GUICreate("Dishes", 885, 400)

$aMain[1][1] = GUICtrlCreateInput("", 5, 5, 200, 20)
$aMain[1][2] = GUICtrlCreateList("", 5, 30, 200, 300)


$aConn[1][1] = GUICtrlCreateInput("", 210, 5, 25, 20)
$aConn[1][2] = GUICtrlCreateList("", 210, 30, 25, 300)

$aAdds[1][1] = GUICtrlCreateInput("", 240, 5, 100, 20)
$aAdds[1][2] = GUICtrlCreateList("", 240, 30, 100, 300)


$aConn[2][1] = GUICtrlCreateInput("", 345, 5, 25, 20)
$aConn[2][2] = GUICtrlCreateList("", 345, 30, 25, 300)

$aAdds[2][1] = GUICtrlCreateInput("", 375, 5, 100, 20)
$aAdds[2][2] = GUICtrlCreateList("", 375, 30, 100, 300)


$aConn[3][1] = GUICtrlCreateInput("", 480, 5, 25, 20)
$aConn[3][2] = GUICtrlCreateList("", 480, 30, 25, 300)

$aAdds[3][1] = GUICtrlCreateInput("", 510, 5, 100, 20)
$aAdds[3][2] = GUICtrlCreateList("", 510, 30, 100, 300)


$aConn[4][1] = GUICtrlCreateInput("", 615, 5, 25, 20)
$aConn[4][2] = GUICtrlCreateList("", 615, 30, 25, 300)

$aAdds[4][1] = GUICtrlCreateInput("", 645, 5, 100, 20)
$aAdds[4][2] = GUICtrlCreateList("", 645, 30, 100, 300)


$aConn[5][1] = GUICtrlCreateInput("", 750, 5, 25, 20)
$aConn[5][2] = GUICtrlCreateList("", 750, 30, 25, 300)

$aAdds[5][1] = GUICtrlCreateInput("", 780, 5, 100, 20)
$aAdds[5][2] = GUICtrlCreateList("", 780, 30, 100, 300)

GUISetState(@SW_SHOW)

_DatabaseCreate("http://www.shellkorskro.dk/dishesdata/get")

_ConnCreate($aConn, 5, 2)
_MainCreate($aMain, 1, 2)
_AddsCreate($aAdds, 5, 2)

_SQLite_Close()
_SQLite_Shutdown()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _DatabaseCreate($sSource, $hDB = -1)
    $sSQL = _INetGetSource($sSource)
        MsgBox(0, "", $sSQL)
    _SQLite_Exec($hDB, $sSQL)
EndFunc

Func _ConnCreate($aConn, $iNum, $iLevel)
    For $i = 1 to $iNum
        GUICtrlSetData($aConn[$i][$iLevel], " ")
        GUICtrlSetData($aConn[$i][$iLevel], "med")
        GUICtrlSetData($aConn[$i][$iLevel], ",")
        GUICtrlSetData($aConn[$i][$iLevel], "og")
        _GUICtrlListBox_SelectString($aConn[$i][$iLevel], " ")
    Next
EndFunc

Func _MainCreate($aMain, $iNum, $iLevel, $hDB = -1)
    Local $hQuery, $aRow, $sMsg
    _SQlite_Query ($hDB, "SELECT * FROM DishesData WHERE Data1 = 'main';", $hQuery)
    For $i = 1 to $iNum
        GUICtrlSetData($aMain[$i][$iLevel], " ")
        _GUICtrlListBox_SelectString($aMain[$i][$iLevel], " ")
    Next
    For $i = 1 to $iNum
        While _SQLite_FetchData ($hQuery, $aRow) = $SQLITE_OK
            GUICtrlSetData($aMain[$i][$iLevel], _ANSI2UNICODE($aRow[2]))
        WEnd
    Next
EndFunc

Func _AddsCreate($aAdds, $iNum, $iLevel, $hDB = -1)
    Local $hQuery, $aRow, $sMsg
    _SQlite_Query ($hDB, "SELECT * FROM DishesData WHERE Data1 = 'adds';", $hQuery)
    For $i = 1 to $iNum
        GUICtrlSetData($aAdds[$i][$iLevel], " ")
        _GUICtrlListBox_SelectString($aAdds[$i][$iLevel], " ")
    Next
    While _SQLite_FetchData ($hQuery, $aRow) = $SQLITE_OK
        For $i = 1 to $iNum
            GUICtrlSetData($aAdds[$i][$iLevel], _ANSI2UNICODE($aRow[2]))
        Next
    WEnd
EndFunc

Func _UNICODE2ANSI($sString = "")
    ; Convert UTF8 to ANSI to insert into DB

    ; http://www.autoitscript.com/forum/index....p?showtopic=85496&view=findpos
    ; ProgAndy
    ; Make ANSI-string representation out of UTF-8

    Local Const $SF_ANSI = 1
    Local Const $SF_UTF8 = 4
    Return BinaryToString(StringToBinary($sString, $SF_UTF8), $SF_ANSI)
EndFunc   ;==>_UNICODE2ANSI

Func _ANSI2UNICODE($sString = "")
    ; Extract ANSI and Convert to UTF8 to display

    ; http://www.autoitscript.com/forum/index....p?showtopic=85496&view=findpos
    ; ProgAndy
    ; Convert ANSI-UTF8 representation to ANSI/Unicode

    Local Const $SF_ANSI = 1
    Local Const $SF_UTF8 = 4
    Return BinaryToString(StringToBinary($sString, $SF_ANSI), $SF_UTF8)
EndFunc   ;==>_ANSI2

Incase that can help others some day.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

What you're doing is exactly the inverse of what needs to be done, if you expect correct, portable and consistent results. So sorry: NO, following your kind advice isn't going to help future readers.

Now, let's see why.

From what I understand, you're storing ANSI [your codepage] in SQLite instead of storing UTF-8 and doing reversewise to get data back. While SQLite doesn't really care about the acual data encoding, this is non standard. Should you have to use your DB on a machine using a different codepage, say greek, russian or thaï, then you would read garbage. Same garbage if you use a third-party SQLite manager to read/change you DB.

Most likely you only need to setup Scite or whatever editor you're using to have your scripts encoded as UTF-8 (with BOM preferably) themselves.

Use the search feature of the forum, this precise issue has been solved a number of times.

An UTF-8 encoded script can store/read any Unicode character (in Unicode plane 0 which is a current minor AutoIt limitation) using the provided SQLite interface and without In/Out surgery on strings.

Edited by jchd

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 here
RegExp tutorial: enough to get started
PCRE 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)

Share this post


Link to post
Share on other sites

What you're doing is exactly the inverse of what needs to be done, if you expect correct, portable and consistent results. So sorry: NO, following your kind advice isn't going to help future readers.

Now, let's see why.

From what I understand, you're storing ANSI [your codepage] in SQLite instead of storing UTF-8 and doing reversewise to get data back. While SQLite doesn't really care about the acual data encoding, this is non standard. Should you have to use your DB on a machine using a different codepage, say greek, russian or thaï, then you would read garbage. Same garbage if you use a third-party SQLite manager to read/change you DB.

Most likely you only need to setup Scite or whatever editor you're using to have your scripts encoded as UTF-8 (with BOM preferably) themselves.

Use the search feature of the forum, this precise issue has been solved a number of times.

An UTF-8 encoded script can store/read any Unicode character (in Unicode plane 0 which is a current minor AutoIt limitation) using the provided SQLite interface and without In/Out surgery on strings.

It did not work with the script UTF8 encoded either, tried. This works, that is what matters to me, as the database is created in memory anyways makes it irrelevant if you should open it with a SQLite manager. The content is stored only for a temp. period to access it faster locally, this MAY help others later if the have the same issue as me and they cannot get the common method to work. And every time I write here I get the comment to use the search function, I can tell you, I have used the search, yes, I can see the issue has been up several times, no, the common answer did not help ME and yes, I used a kinda-method that worked for me.

Share this post


Link to post
Share on other sites

That your workaround works for you in your precise context doensn't make it better than it is. The issue is that it's likely to utterly confuse future readers using it in their different context, possibly damaging a valuable database.

You can trust me: one definitely need to store non-pure ASCII text in some Unicode encoding in order to store them reliably using SQLite interface provided by AutoIt. The easiest for doing so with litterals is to use UTF-8 + BOM encoding.

I've noticed you used a memory DB but this doesn't preclude you from backing it up to disk for instance. I understand you use it for temporary storage but I'd like anyway to help you sort out why the correct procedure doesn't work for you.

Can you provide example data and simple code showing the issue you experienced (without your ANSI trick).


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 here
RegExp tutorial: enough to get started
PCRE 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)

Share this post


Link to post
Share on other sites

I am long past that, all those codes and files are long gone, I worked further on with the code that I could get to work.

Share this post


Link to post
Share on other sites

Ok then good luck with your development(s).


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 here
RegExp tutorial: enough to get started
PCRE 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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0