Sign in to follow this  
Followers 0
czardas

_WinAPI_MultiByteToWideChar() String or Structure

22 posts in this topic

Here is a script which removes diacritic marks. It appears to work, but I'm not entirely sure what is happening. There was a certain amount of trial and error involved in writing this, so I would like someone with more experience to look at it. It feels like a clumsy technique I'm using. Diacritics should be removed from both extended ansi and from unicode. I couldn't find a way to do this without calling _WinAPI_MultiByteToWideChar twice.

#include <WinAPI.au3>

#region - Example
Local $sTestString = ""
;For $i = 192 To 255
;    $sTestString &= Chr($i) ; extended latin from Windows 1252 code page
;Next

For $i = 256 To 382
    $sTestString &= ChrW($i) ; Extended latin alpha characters
Next

Local $newString = _StripDiacriticMarks($sTestString)
MsgBox(0, "", $sTestString & @LF & @LF & $newString)
#endregion

Func _StripDiacriticMarks($sText)
    If Not IsString($sText) Then Return SetError(1, 0, $sText)

    Local $sCurrChar, $sSplitChar, $sElement, $sNewString = ""
    For $i = 1 To StringLen($sText)
        $sCurrChar = StringMid($sText, $i, 1)

        $sSplitChar = _WinAPI_MultiByteToWideChar($sCurrChar, 3, $MB_COMPOSITE)
        $sElement = DllStructGetData($sSplitChar, 1)
        If StringIsAlpha($sElement) Then
            $sCurrChar = $sElement

        ElseIf DllStructGetSize($sSplitChar) > 4 Then
            $sSplitChar = _WinAPI_MultiByteToWideChar($sCurrChar, 3, $MB_COMPOSITE, True)

            For $j = 1 To Stringlen($sSplitChar)
                $sElement = StringMid($sSplitChar, $j, 1)
                If StringIsAlpha($sElement) Then
                    $sCurrChar = $sElement
                    ExitLoop
                EndIf
            Next
        EndIf
        $sNewString &= $sCurrChar
    Next
    Return $sNewString
EndFunc

I'm sure I don't need all this code.

1 person likes this

Share this post


Link to post
Share on other sites

I personally can't see any other way, but then I won't pretend that I'm an expert in character encoding. This is where jchd and trancexx come into their element.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Okay thanks for the responce. I imagine I'll eventually figure out what's best. I'll use this until that time comes, unless someone can improve it. At least it's working AFAIK. I think it's pretty useful for (catch all) search features. Most people type the keys available on their keyboard, and potentially valid results are often missed because of correct (or incorrect) diacritic mark interference.

Edited by czardas

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

There are some charw that do not work for me, including

$sTestString = ChrW(272) and $sTestString = ChrW(338)

I noticed that myself. I'm not sure why though. Actually those two are okay. One is a letter in itself and the other is a ligature. I was thinking you meant some others. There are one or two others that seem strange to me:

Here's the main culprit.

Ŀ

Edited by czardas

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

You can try with something like this as alternative:

Func _StripDiacriticMarks($sText)
    Local $oMessageStream = ObjCreate("ADODB.Stream")
    If @error Then Return SetError(1, 0, $sText)
    Local $sOut
    With $oMessageStream
        .Type = 2
        .charset = "us-ascii"
        .Open()
        .WriteText($sText)
        .Flush()
        .Position = 0
        $sOut = .ReadText()
        .Close()
    EndWith
    Return $sOut
EndFunc
Edited by trancexx
1 person likes this

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Thanks for the code trancexx. It's a nice example (I can certainly learn from it :)), but it replaces stuff it doesn't like with ? (question marks). I don't want the function to corrupt any other types of character. A quick test shows some of the characters are being corrupted:

ßÞIJijĸŋŊʼn× ==> ?????????

Don't worry about it: the function I have written seems good enough. I just didn't like calling _WinAPI_MultiByteToWideChar twice. I still need to test this on more strings to be certain there's no other corruption.

Edited by czardas

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

If you want a more complete covering for Unicode, try this:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_AU3Check=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <sqlite.au3>
#include "SQLiteExtLoad.au3"

_SQLite_Startup("C:\Program Files (x86)\SQLite\sqlite3.dll")
_SQLite_LoadAutoExtension("..\bin\unifuzz.dll")
_SQLite_Open() ; use a :memory: DB


Local $sWeird = "azerty àƵĕřťƳ ʤʯΐΰӝӸḄṳἻᾀÅÇḈﻺ Å Ɽ♬♞☊◔╳∌ῴ"
Local $sNoDiacr = _Unaccent($sWeird)
MsgBox(0, "Unaccent demo", "Once diacritics are removed" & @LF & $sWeird & @LF & "becomes" & @LF & $sNoDiacr)
_SQLite_Close()
_SQLite_ShutDown()

Func _Unaccent($sStr)
Local $aRow
_SQLite_QuerySingleRow(-1, "select unaccent(" & _SQLite_FastEscape($sStr) & ");", $aRow)
Return($aRow[0])
EndFunc

Use forum search for posted includes.

Also you now have access to a whole lot of Unicode-aware string and other functions. Read the header of the C source of the extension about details.

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

#11 ·  Posted (edited)

Thanks a lot jchd. :thumbsup:

Is there a reason why my function would not work with all unicode? - I'm not sure. Scite doesn't seem to like $sWeird BTW. Let me get back to you later, I have several other things to do today.

Got the includes.

Edited by czardas

Share this post


Link to post
Share on other sites

The test string requires the file to be in UTF-8 encoding.

Yes, the reason is that StringIsAlpha only checks for A-Z and possibly ç and some other Latin-1 characters. Same for the function trancexx supplied. They won't cope with greek or cyrillic, for instance.

Append your code and let it run againts the same string to see the difference.


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

Yes I had thought that it would not work for other alphabets. In fact it was the intention, but the additional options would be good to have. I'll play around with it. Thanks again.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I had intended to return to this topic before now. Anyway I never managed to get your example to run jchd. I get the following error:

Return($aRow[0])

Return($aRow^ ERROR

Subscript used with non-Array variable

I have decided to adopt the brute force approach and stick to latin which is more familiar territory to me (at least for the time being). I don't know what effect a more greedy function might have on other languages, for example Chinese. Also I find I learn a lot by taking things apart piece by piece. I believe the following function removes accents from all latin characters and should also work with grapheme clusters. It's much more effective than my original attempt. The data was gathered using this online app: http://www.conlang.info/cgi/dia.cgi

Func _StripAccentsLatin($sText)
    If Not IsString($sText) Then Return SetError(1, 0, "")
    $sText = StringRegExpReplace($sText, "[\x{00E1}\x{0103}\x{01CE}\x{00E2}\x{00E4}\x{0227}\x{1EA1}\x{0201}\x{00E0}\x{1EA3}\x{0203}\x{0101}\x{0105}\x{1D8F}\x{1E9A}\x{00E5}\x{1E01}\x{2C65}\x{00E3}]", ChrW(0x61))
    $sText = StringRegExpReplace($sText, "[\x{1E03}\x{1E05}\x{0253}\x{1E07}\x{1D6C}\x{1D80}\x{0180}\x{0183}]", ChrW(0x62))
    $sText = StringRegExpReplace($sText, "[\x{0107}\x{010D}\x{00E7}\x{0109}\x{0255}\x{010B}\x{0188}\x{023C}]", ChrW(0x63))
    $sText = StringRegExpReplace($sText, "[\x{010F}\x{1E11}\x{1E13}\x{0221}\x{1E0B}\x{1E0D}\x{0257}\x{1E0F}\x{1D6D}\x{1D81}\x{0111}\x{0256}\x{018C}]", ChrW(0x64))
    $sText = StringRegExpReplace($sText, "[\x{00E9}\x{0115}\x{011B}\x{0229}\x{00EA}\x{1E19}\x{00EB}\x{0117}\x{1EB9}\x{0205}\x{00E8}\x{1EBB}\x{0207}\x{0113}\x{2C78}\x{0119}\x{1D92}\x{0247}\x{1EBD}\x{1E1B}]", ChrW(0x65))
    $sText = StringRegExpReplace($sText, "[\x{1E1F}\x{0192}\x{1D6E}\x{1D82}]", ChrW(0x66))
    $sText = StringRegExpReplace($sText, "[\x{01F5}\x{011F}\x{01E7}\x{0123}\x{011D}\x{0121}\x{0260}\x{1E21}\x{1D83}\x{01E5}]", ChrW(0x67))
    $sText = StringRegExpReplace($sText, "[\x{1E2B}\x{021F}\x{1E29}\x{0125}\x{2C68}\x{1E27}\x{1E23}\x{1E25}\x{0266}\x{1E96}\x{0127}]", ChrW(0x68))
    $sText = StringRegExpReplace($sText, "[\x{00ED}\x{012D}\x{01D0}\x{00EE}\x{00EF}\x{1ECB}\x{0209}\x{00EC}\x{1EC9}\x{020B}\x{012B}\x{012F}\x{1D96}\x{0268}\x{0129}\x{1E2D}]", ChrW(0x69))
    $sText = StringRegExpReplace($sText, "[\x{01F0}\x{0135}\x{029D}\x{0249}]", ChrW(0x6A))
    $sText = StringRegExpReplace($sText, "[\x{1E31}\x{01E9}\x{0137}\x{2C6A}\x{A743}\x{1E33}\x{0199}\x{1E35}\x{1D84}\x{A741}]", ChrW(0x6B))
    $sText = StringRegExpReplace($sText, "[\x{013A}\x{019A}\x{026C}\x{013E}\x{013C}\x{1E3D}\x{0234}\x{1E37}\x{2C61}\x{A749}\x{1E3B}\x{0140}\x{026B}\x{1D85}\x{026D}\x{0142}]", ChrW(0x6C))
    $sText = StringRegExpReplace($sText, "[\x{1E3F}\x{1E41}\x{1E43}\x{0271}\x{1D6F}\x{1D86}]", ChrW(0x6D))
    $sText = StringRegExpReplace($sText, "[\x{0144}\x{0148}\x{0146}\x{1E4B}\x{0235}\x{1E45}\x{1E47}\x{01F9}\x{0272}\x{1E49}\x{019E}\x{1D70}\x{1D87}\x{0273}\x{00F1}\x{0149}\x{014B}]", ChrW(0x6E))
    $sText = StringRegExpReplace($sText, "[\x{00F3}\x{014F}\x{01D2}\x{00F4}\x{00F6}\x{022F}\x{1ECD}\x{0151}\x{020D}\x{00F2}\x{1ECF}\x{01A1}\x{020F}\x{A74B}\x{A74D}\x{2C7A}\x{014D}\x{01EB}\x{00F8}\x{00F5}]", ChrW(0x6F))
    $sText = StringRegExpReplace($sText, "[\x{1E55}\x{1E57}\x{A753}\x{01A5}\x{1D71}\x{1D88}\x{A755}\x{1D7D}\x{A751}]", ChrW(0x70))
    $sText = StringRegExpReplace($sText, "[\x{A759}\x{02A0}\x{024B}\x{A757}]", ChrW(0x71))
    $sText = StringRegExpReplace($sText, "[\x{0155}\x{0159}\x{0157}\x{1E59}\x{1E5B}\x{0211}\x{027E}\x{0213}\x{1E5F}\x{027C}\x{1D72}\x{1D89}\x{024D}\x{027D}]", ChrW(0x72))
    $sText = StringRegExpReplace($sText, "[\x{015B}\x{0161}\x{015F}\x{015D}\x{0219}\x{1E61}\x{1E63}\x{0282}\x{1D74}\x{1D8A}\x{023F}]", ChrW(0x73))
    $sText = StringRegExpReplace($sText, "[\x{0165}\x{0163}\x{1E71}\x{021B}\x{0236}\x{1E97}\x{2C66}\x{1E6B}\x{1E6D}\x{01AD}\x{1E6F}\x{1D75}\x{01AB}\x{0288}\x{0167}]", ChrW(0x74))
    $sText = StringRegExpReplace($sText, "[\x{00FA}\x{016D}\x{01D4}\x{00FB}\x{1E77}\x{00FC}\x{1E73}\x{1EE5}\x{0171}\x{0215}\x{00F9}\x{1EE7}\x{01B0}\x{0217}\x{016B}\x{0173}\x{1D99}\x{016F}\x{0169}\x{1E75}]", ChrW(0x75))
    $sText = StringRegExpReplace($sText, "[\x{2C74}\x{A75F}\x{1E7F}\x{028B}\x{1D8C}\x{2C71}\x{1E7D}]", ChrW(0x76))
    $sText = StringRegExpReplace($sText, "[\x{1E83}\x{0175}\x{1E85}\x{1E87}\x{1E89}\x{1E81}\x{2C73}\x{1E98}]", ChrW(0x77))
    $sText = StringRegExpReplace($sText, "[\x{1E8D}\x{1E8B}\x{1D8D}]", ChrW(0x78))
    $sText = StringRegExpReplace($sText, "[\x{00FD}\x{0177}\x{00FF}\x{1E8F}\x{1EF5}\x{1EF3}\x{01B4}\x{1EF7}\x{1EFF}\x{0233}\x{1E99}\x{024F}\x{1EF9}]", ChrW(0x79))
    $sText = StringRegExpReplace($sText, "[\x{017A}\x{017E}\x{1E91}\x{0291}\x{2C6C}\x{017C}\x{1E93}\x{0225}\x{1E95}\x{1D76}\x{1D8E}\x{0290}\x{01B6}\x{0240}]", ChrW(0x7A))
    $sText = StringRegExpReplace($sText, "[\x{00C1}\x{0102}\x{01CD}\x{00C2}\x{00C4}\x{0226}\x{1EA0}\x{0200}\x{00C0}\x{1EA2}\x{0202}\x{0100}\x{0104}\x{00C5}\x{1E00}\x{023A}\x{00C3}]", ChrW(0x41))
    $sText = StringRegExpReplace($sText, "[\x{1E02}\x{1E04}\x{0181}\x{1E06}\x{0243}\x{0182}]", ChrW(0x42))
    $sText = StringRegExpReplace($sText, "[\x{0106}\x{010C}\x{00C7}\x{0108}\x{010A}\x{0187}\x{023B}]", ChrW(0x43))
    $sText = StringRegExpReplace($sText, "[\x{010E}\x{1E10}\x{1E12}\x{1E0A}\x{1E0C}\x{018A}\x{1E0E}\x{0110}\x{018B}]", ChrW(0x44))
    $sText = StringRegExpReplace($sText, "[\x{00C9}\x{0114}\x{011A}\x{0228}\x{00CA}\x{1E18}\x{00CB}\x{0116}\x{1EB8}\x{0204}\x{00C8}\x{1EBA}\x{0206}\x{0112}\x{0118}\x{0246}\x{1EBC}\x{1E1A}]", ChrW(0x45))
    $sText = StringRegExpReplace($sText, "[\x{1E1E}\x{0191}]", ChrW(0x46))
    $sText = StringRegExpReplace($sText, "[\x{01F4}\x{011E}\x{01E6}\x{0122}\x{011C}\x{0120}\x{0193}\x{1E20}\x{01E4}]", ChrW(0x47))
    $sText = StringRegExpReplace($sText, "[\x{1E2A}\x{021E}\x{1E28}\x{0124}\x{2C67}\x{1E26}\x{1E22}\x{1E24}\x{0126}]", ChrW(0x48))
    $sText = StringRegExpReplace($sText, "[\x{00CD}\x{012C}\x{01CF}\x{00CE}\x{00CF}\x{0130}\x{1ECA}\x{0208}\x{00CC}\x{1EC8}\x{020A}\x{012A}\x{012E}\x{0197}\x{0128}\x{1E2C}]", ChrW(0x49))
    $sText = StringRegExpReplace($sText, "[\x{0134}\x{0248}]", ChrW(0x4A))
    $sText = StringRegExpReplace($sText, "[\x{1E30}\x{01E8}\x{0136}\x{2C69}\x{A742}\x{1E32}\x{0198}\x{1E34}\x{A740}]", ChrW(0x4B))
    $sText = StringRegExpReplace($sText, "[\x{0139}\x{023D}\x{013D}\x{013B}\x{1E3C}\x{1E36}\x{2C60}\x{A748}\x{1E3A}\x{013F}\x{2C62}\x{0141}]", ChrW(0x4C))
    $sText = StringRegExpReplace($sText, "[\x{1E3E}\x{1E40}\x{1E42}\x{2C6E}]", ChrW(0x4D))
    $sText = StringRegExpReplace($sText, "[\x{0143}\x{0147}\x{0145}\x{1E4A}\x{1E44}\x{1E46}\x{01F8}\x{019D}\x{1E48}\x{0220}\x{00D1}\x{014A}]", ChrW(0x4E))
    $sText = StringRegExpReplace($sText, "[\x{00D3}\x{014E}\x{01D1}\x{00D4}\x{00D6}\x{022E}\x{1ECC}\x{0150}\x{020C}\x{00D2}\x{1ECE}\x{01A0}\x{020E}\x{A74A}\x{A74C}\x{014C}\x{019F}\x{01EA}\x{00D8}\x{00D5}]", ChrW(0x4F))
    $sText = StringRegExpReplace($sText, "[\x{1E54}\x{1E56}\x{A752}\x{01A4}\x{A754}\x{2C63}\x{A750}]", ChrW(0x50))
    $sText = StringRegExpReplace($sText, "[\x{A758}\x{A756}]", ChrW(0x51))
    $sText = StringRegExpReplace($sText, "[\x{0154}\x{0158}\x{0156}\x{1E58}\x{1E5A}\x{0210}\x{0212}\x{1E5E}\x{024C}\x{2C64}]", ChrW(0x52))
    $sText = StringRegExpReplace($sText, "[\x{015A}\x{0160}\x{015E}\x{015C}\x{0218}\x{1E60}\x{1E62}]", ChrW(0x53))
    $sText = StringRegExpReplace($sText, "[\x{0164}\x{0162}\x{1E70}\x{021A}\x{023E}\x{1E6A}\x{1E6C}\x{01AC}\x{1E6E}\x{01AE}\x{0166}]", ChrW(0x54))
    $sText = StringRegExpReplace($sText, "[\x{00DA}\x{016C}\x{01D3}\x{00DB}\x{1E76}\x{00DC}\x{1E72}\x{1EE4}\x{0170}\x{0214}\x{00D9}\x{1EE6}\x{01AF}\x{0216}\x{016A}\x{0172}\x{016E}\x{0168}\x{1E74}]", ChrW(0x55))
    $sText = StringRegExpReplace($sText, "[\x{A75E}\x{1E7E}\x{01B2}\x{1E7C}]", ChrW(0x56))
    $sText = StringRegExpReplace($sText, "[\x{1E82}\x{0174}\x{1E84}\x{1E86}\x{1E88}\x{1E80}\x{2C72}]", ChrW(0x57))
    $sText = StringRegExpReplace($sText, "[\x{1E8C}\x{1E8A}]", ChrW(0x58))
    $sText = StringRegExpReplace($sText, "[\x{00DD}\x{0176}\x{0178}\x{1E8E}\x{1EF4}\x{1EF2}\x{01B3}\x{1EF6}\x{1EFE}\x{0232}\x{024E}\x{1EF8}]", ChrW(0x59))
    $sText = StringRegExpReplace($sText, "[\x{0179}\x{017D}\x{1E90}\x{2C6B}\x{017B}\x{1E92}\x{0224}\x{1E94}\x{01B5}]", ChrW(0x5A))
    $sText = StringRegExpReplace($sText, "[\x{01FD}\x{01E3}]", ChrW(0xE6))
    $sText = StringRegExpReplace($sText, "[\x{01FC}\x{01E2}]", ChrW(0xC6))
    $sText = StringRegExpReplace($sText, "[\x{1D90}]", ChrW(0x251))
    $sText = StringRegExpReplace($sText, "[\x{A73B}]", ChrW(0xA739))
    $sText = StringRegExpReplace($sText, "[\x{A73A}]", ChrW(0xA738))
    $sText = StringRegExpReplace($sText, "[\x{A72F}]", ChrW(0xA72D))
    $sText = StringRegExpReplace($sText, "[\x{A72E}]", ChrW(0xA72C))
    $sText = StringRegExpReplace($sText, "[\x{01C6}]", ChrW(0x01F3))
    $sText = StringRegExpReplace($sText, "[\x{01C4}]", ChrW(0x1F1))
    $sText = StringRegExpReplace($sText, "[\x{0286}\x{1D8B}\x{1D98}]", ChrW(0x283))
    $sText = StringRegExpReplace($sText, "[\x{01EF}\x{0293}\x{1D9A}\x{01BA}]", ChrW(0x292))
    $sText = StringRegExpReplace($sText, "[\x{01EE}]", ChrW(0x1B7))
    $sText = StringRegExpReplace($sText, "[\x{029B}]", ChrW(0x262))
    $sText = StringRegExpReplace($sText, "[\x{0267}]", ChrW(0xA727))
    $sText = StringRegExpReplace($sText, "[\x{1D7B}]", ChrW(0x26A))
    $sText = StringRegExpReplace($sText, "[\x{1D7C}]", ChrW(0x269))
    $sText = StringRegExpReplace($sText, "[\x{1D0C}]", ChrW(0x29F))
    $sText = StringRegExpReplace($sText, "[\x{019B}]", ChrW(0x3BB))
    $sText = StringRegExpReplace($sText, "[\x{025A}\x{1D95}]", ChrW(0x259))
    $sText = StringRegExpReplace($sText, "[\x{A765}\x{A767}]", ChrW(0xFE))
    $sText = StringRegExpReplace($sText, "[\x{A764}\x{A766}]", ChrW(0xDE))
    $sText = StringRegExpReplace($sText, "[\x{1D7E}]", ChrW(0x1D1C))
    $sText = StringRegExpReplace($sText, "[\x{1D7F}]", ChrW(0x28A))
    $sText = StringRegExpReplace($sText, "[\x{0300}\x{0301}\x{0302}\x{0303}\x{0304}\x{0305}\x{0306}\x{0307}\x{0308}\x{0309}\x{030A}\x{030B}\x{030C}\x{030D}\x{030E}\x{030F}\x{0310}\x{0311}\x{0312}\x{0313}\x{0314}\x{0315}\x{0316}\x{0317}\x{0318}\x{0319}\x{031A}\x{031B}\x{031C}\x{031D}\x{031E}\x{031F}\x{0320}\x{0321}\x{0322}\x{0323}\x{0324}\x{0325}\x{0326}\x{0327}\x{0328}\x{0329}\x{032A}\x{032B}\x{032C}\x{032D}\x{032E}\x{032F}\x{0330}\x{0331}\x{0332}\x{0333}\x{0334}\x{0335}\x{0336}\x{0337}\x{0338}\x{0339}\x{033A}\x{033B}\x{033C}\x{033D}\x{033E}\x{033F}\x{0340}\x{0341}\x{0342}\x{0343}\x{0344}\x{0345}\x{0346}\x{0347}\x{0348}\x{0349}\x{034A}\x{034B}\x{034C}\x{034D}\x{034E}\x{034F}\x{0350}\x{0351}\x{0352}\x{0353}\x{0354}\x{0355}\x{0356}\x{0357}\x{0358}\x{0359}\x{035A}\x{035B}\x{035C}\x{035D}\x{035E}\x{035F}\x{0360}\x{0361}\x{0362}\x{0363}\x{0364}\x{0365}\x{0366}\x{0367}\x{0368}\x{0369}\x{036A}\x{036B}\x{036C}\x{036D}\x{036E}\x{036F}]", "")
    Return $sText
EndFunc ;==> _StripAccentsLatin

Duh, code was missing a comma.

Edited by czardas

Share this post


Link to post
Share on other sites

Are you sure no error occurs, e.g. the SQLite extension isn't found or something similar?


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

Umm, that's what I suspected.

Here you are.


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

Thanks jchd. Looking at the c source. It certainly looks interesting. I think it should work now, but I'll test it in the morning.

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

I just got around to trying this again and I'm still having no joy with it. I have tried modifying the path to full script path (where I put the dll) and still get the same error.

Edited by czardas

Share this post


Link to post
Share on other sites

Which error are you getting and when?


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