Hi, I have array with words that contain special characters found in German language
and I'd like to convert that array to UTF-8 encoded words equivalent.
Thanks for any advice!
Hi, I have array with words that contain special characters found in German language
and I'd like to convert that array to UTF-8 encoded words equivalent.
Thanks for any advice!
Hi pulsar777!
The code found on the Internet, but I don't understand either.
Sub Test() Debug.Print Sp2Utf8("special characters") 'you can input special characters here End Sub Function Sp2Utf8(szCode As String) With CreateObject("MSScriptControl.ScriptControl") .Language = "JavaScript" .addcode "function decode(str){return escape(str).replace(/%/g,'\\')}" Sp2Utf8 = .Eval("decode('" & szCode & "')") End With End Function
Thanks man ! Even the regular expressions you posted don't do the trick.
I found out those inputs to database are iso-8859-2 encoded, but db automatically changes it to utf-8 (coverts special chars to weird symbols)
And I think that's why it cannot convert those symbols back from db to front-end.
Use:
Private Declare Function OemToCharA Lib "user32.dll" (ByVal lpszSrc As String, ByVal lpszDst As String) As Long Public Function F_ASC_ANS(ByVal Text As String) As String OemToCharA Text, Text F_ASC_ANS = Text End Function Sub M_snb() MsgBox F_ASC_ANS("äëïöüß") End Sub