# Decode quoted printable text unicode UTF-8 with vba



## gvp9000

In a vcard file greek names are writen like this

=CE=A4=CE=AD=CF=83=CF=84=20=74=65=73=74

How can I decode it with vba ?

If you put the above string in UTF-8 Code in the following page
Unicode, Hexadecimal, Decimal NCR, UTF-8 Converter -- EndMemo
 and you press convert you will get the string "Τέστ test" (first 4 characters are Greek).

How can I do it with vba in a shortest way than the following ?
Thank you.



		Code:
__


'VBScript QuotedPrintableDecode decoding Function for English and Greek characters
'26/11/2016 by gvp
Public Function QuotedPrintableDecode(SourceData)
Dim str_ As String
Dim len_ As Integer

'remove "=" and ";" from SourceData
SourceData = Replace(SourceData, "=", "")
SourceData = Replace(SourceData, ";", "")

'calculate length
len_ = Len(SourceData)

'set string ="" and flag
str_ = ""

'check characters step=2
For i = 0 To (len_ / 2 - 1)
x = Mid(SourceData, 1 + 2 * i, 2)

                    'greek characters
                    If x = "CE" Or x = "CF" Then
                    x = Mid(SourceData, 1 + 2 * i, 4)
                    If x = "CE91" Then g = "Á"
                    If x = "CE92" Then g = "Â"
                    If x = "CE93" Then g = "Ã"
                    If x = "CE94" Then g = "Ä"
                    If x = "CE95" Then g = "Å"
                    If x = "CE96" Then g = "Æ"
                    If x = "CE97" Then g = "Ç"
                    If x = "CE98" Then g = "È"
                    If x = "CE99" Then g = "É"
                    If x = "CE9A" Then g = "Ê"
                    If x = "CE9B" Then g = "Ë"
                    If x = "CE9C" Then g = "Ì"
                    If x = "CE9D" Then g = "Í"
                    If x = "CE9E" Then g = "Î"
                    If x = "CE9F" Then g = "Ï"
                    If x = "CEA0" Then g = "Ð"
                    If x = "CEA1" Then g = "Ñ"
                    If x = "CEA3" Then g = "Ó"
                    If x = "CEA4" Then g = "Ô"
                    If x = "CEA5" Then g = "Õ"
                    If x = "CEA6" Then g = "Ö"
                    If x = "CEA7" Then g = "×"
                    If x = "CEA8" Then g = "Ø"
                    If x = "CEA9" Then g = "Ù"
                    If x = "CEB1" Then g = "á"
                    If x = "CEB2" Then g = "â"
                    If x = "CEB3" Then g = "ã"
                    If x = "CEB4" Then g = "ä"
                    If x = "CEB5" Then g = "å"
                    If x = "CEB6" Then g = "æ"
                    If x = "CEB7" Then g = "ç"
                    If x = "CEB8" Then g = "è"
                    If x = "CEB9" Then g = "é"
                    If x = "CEBA" Then g = "ê"
                    If x = "CEBB" Then g = "ë"
                    If x = "CEBC" Then g = "ì"
                    If x = "CEBD" Then g = "í"
                    If x = "CEBE" Then g = "î"
                    If x = "CEBF" Then g = "ï"
                    If x = "CF80" Then g = "ð"
                    If x = "CF81" Then g = "ñ"
                    If x = "CF83" Then g = "ó"
                    If x = "CF82" Then g = "ò"
                    If x = "CF84" Then g = "ô"
                    If x = "CF85" Then g = "õ"
                    If x = "CF86" Then g = "ö"
                    If x = "CF87" Then g = "÷"
                    If x = "CF88" Then g = "ø"
                    If x = "CF89" Then g = "ù"
                    If x = "CEAC" Then g = "Ü"
                    If x = "CEAD" Then g = "Ý"
                    If x = "CEAE" Then g = "Þ"
                    If x = "CEAF" Then g = "ß"
                    If x = "CF8C" Then g = "ü"
                    If x = "CF8D" Then g = "ý"
                    If x = "CF8E" Then g = "þ"
                    If x = "CEB0" Then g = "à"
                    If x = "CE90" Then g = "À"
                    If x = "CE86" Then g = "¢"
                    If x = "CE88" Then g = "¸"
                    If x = "CE89" Then g = "¹"
                    If x = "CE8A" Then g = "º"
                    If x = "CE8C" Then g = "¼"
                    If x = "CE8E" Then g = "¾"
                    If x = "CE8F" Then g = "¿"
                    i = i + 1
                    GoTo 10:
                    End If
                    
                    'english characters
                    If Left(x, 1) = "4" Or Left(x, 1) = "5" Or Left(x, 1) = "6" Or Left(x, 1) = "7" Then
                    If x = "41" Then g = "A"
                    If x = "42" Then g = "B"
                    If x = "43" Then g = "C"
                    If x = "44" Then g = "D"
                    If x = "45" Then g = "E"
                    If x = "46" Then g = "F"
                    If x = "47" Then g = "G"
                    If x = "48" Then g = "H"
                    If x = "49" Then g = "I"
                    If x = "4A" Then g = "J"
                    If x = "4B" Then g = "K"
                    If x = "4C" Then g = "L"
                    If x = "4D" Then g = "M"
                    If x = "4E" Then g = "N"
                    If x = "4F" Then g = "O"
                    If x = "50" Then g = "P"
                    If x = "51" Then g = "Q"
                    If x = "52" Then g = "R"
                    If x = "53" Then g = "S"
                    If x = "54" Then g = "T"
                    If x = "55" Then g = "U"
                    If x = "56" Then g = "V"
                    If x = "57" Then g = "W"
                    If x = "58" Then g = "X"
                    If x = "59" Then g = "Y"
                    If x = "5A" Then g = "Z"
                    If x = "61" Then g = "a"
                    If x = "62" Then g = "b"
                    If x = "63" Then g = "c"
                    If x = "64" Then g = "d"
                    If x = "65" Then g = "e"
                    If x = "66" Then g = "f"
                    If x = "67" Then g = "g"
                    If x = "68" Then g = "h"
                    If x = "69" Then g = "i"
                    If x = "6A" Then g = "j"
                    If x = "6B" Then g = "k"
                    If x = "6C" Then g = "l"
                    If x = "6D" Then g = "m"
                    If x = "6E" Then g = "n"
                    If x = "6F" Then g = "o"
                    If x = "70" Then g = "p"
                    If x = "71" Then g = "q"
                    If x = "72" Then g = "r"
                    If x = "73" Then g = "s"
                    If x = "74" Then g = "t"
                    If x = "75" Then g = "u"
                    If x = "76" Then g = "v"
                    If x = "77" Then g = "w"
                    If x = "78" Then g = "x"
                    If x = "79" Then g = "y"
                    If x = "7A" Then g = "z"
                    GoTo 10:
                    End If
        
                    'comma space dot etc
                    If Left(x, 1) = "2" Then
                    If x = "2E" Then g = "."
                    If x = "20" Then g = " "
                    If x = "2C" Then g = ","
                    If x = "21" Then g = "!"
                    If x = "2D" Then g = "-"
                    GoTo 10:
                    End If
                    
                    'numbers
                    If Left(x, 1) = "3" Then
                    If x = "30" Then g = "0"
                    If x = "31" Then g = "1"
                    If x = "32" Then g = "2"
                    If x = "33" Then g = "3"
                    If x = "34" Then g = "4"
                    If x = "35" Then g = "5"
                    If x = "36" Then g = "6"
                    If x = "37" Then g = "7"
                    If x = "38" Then g = "8"
                    If x = "39" Then g = "9"
                    GoTo 10:
                    End If
        
        If fla_ = 0 Then
        MsgBox ("At least one unknown character found with UTF-8 Code = " & Mid(SourceData, 1 + 2 * i, 4))
        fla_ = 1
        End If
        
10:
str_ = str_ & g
Next i

'DecodedString = str_
QuotedPrintableDecode = str_
    
End Function


----------



## HackSlash

The first thing I would do is replace the IF statements with SELECT CASE:

Select Case Statement in Excel VBA Macro Code. Alternative to Multiple If, Or, And Else Statements


----------



## gvp9000

*Please delete the previous post*
=======================
I need to decode strings like this
=CE=A4=CE=AD=CF=83=CF=84=20=74=65=73=74 (4 first characters are Greek + space + 4 latin characters)

How can I decode it with vba ?

If you put the above string (without the "=") 
"CE A4 CE AD CF 83 CF 84 20 74 65 73 74" 
in UTF-8 Code in the following page
Unicode, Hexadecimal, Decimal NCR, UTF-8 Converter -- EndMemo

and you press convert you will get the string 

*"Τέστ test"* (4 first characters are Greek + space + 4 latin characters).

How can I do it with vba in a shortest way than the following ?
Thank you.
==============================


		Code:
__


'VBScript QuotedPrintableDecode decoding Function for English and Greek characters
'26/11/2016 by gvp
Public Function QuotedPrintableDecode(SourceData)
Dim str_ As String
Dim len_ As Integer

'remove "=" and ";" from SourceData
SourceData = Replace(SourceData, "=", "")
SourceData = Replace(SourceData, ";", "")

'calculate length
len_ = Len(SourceData)

'set string ="" and flag
str_ = ""

'check characters step=2
For i = 0 To (len_ / 2 - 1)
x = Mid(SourceData, 1 + 2 * i, 2)

                    'greek characters
                    If x = "CE" Or x = "CF" Then
                    x = Mid(SourceData, 1 + 2 * i, 4)
                    If x = "CE91" Then g = "Α"
                    If x = "CE92" Then g = "Β"
                    If x = "CE93" Then g = "Γ"
                    If x = "CE94" Then g = "Δ"
                    If x = "CE95" Then g = "Ε"
                    If x = "CE96" Then g = "Ζ"
                    If x = "CE97" Then g = "Η"
                    If x = "CE98" Then g = "Θ"
                    If x = "CE99" Then g = "Ι"
                    If x = "CE9A" Then g = "Κ"
                    If x = "CE9B" Then g = "Λ"
                    If x = "CE9C" Then g = "Μ"
                    If x = "CE9D" Then g = "Ν"
                    If x = "CE9E" Then g = "Ξ"
                    If x = "CE9F" Then g = "Ο"
                    If x = "CEA0" Then g = "Π"
                    If x = "CEA1" Then g = "Ρ"
                    If x = "CEA3" Then g = "Σ"
                    If x = "CEA4" Then g = "Τ"
                    If x = "CEA5" Then g = "Υ"
                    If x = "CEA6" Then g = "Φ"
                    If x = "CEA7" Then g = "Χ"
                    If x = "CEA8" Then g = "Ψ"
                    If x = "CEA9" Then g = "Ω"
                    If x = "CEB1" Then g = "α"
                    If x = "CEB2" Then g = "β"
                    If x = "CEB3" Then g = "γ"
                    If x = "CEB4" Then g = "δ"
                    If x = "CEB5" Then g = "ε"
                    If x = "CEB6" Then g = "ζ"
                    If x = "CEB7" Then g = "η"
                    If x = "CEB8" Then g = "θ"
                    If x = "CEB9" Then g = "ι"
                    If x = "CEBA" Then g = "κ"
                    If x = "CEBB" Then g = "λ"
                    If x = "CEBC" Then g = "μ"
                    If x = "CEBD" Then g = "ν"
                    If x = "CEBE" Then g = "ξ"
                    If x = "CEBF" Then g = "ο"
                    If x = "CF80" Then g = "π"
                    If x = "CF81" Then g = "ρ"
                    If x = "CF83" Then g = "σ"
                    If x = "CF82" Then g = "ς"
                    If x = "CF84" Then g = "τ"
                    If x = "CF85" Then g = "υ"
                    If x = "CF86" Then g = "φ"
                    If x = "CF87" Then g = "χ"
                    If x = "CF88" Then g = "ψ"
                    If x = "CF89" Then g = "ω"
                    If x = "CEAC" Then g = "ά"
                    If x = "CEAD" Then g = "έ"
                    If x = "CEAE" Then g = "ή"
                    If x = "CEAF" Then g = "ί"
                    If x = "CF8C" Then g = "ό"
                    If x = "CF8D" Then g = "ύ"
                    If x = "CF8E" Then g = "ώ"
                    If x = "CEB0" Then g = "ΰ"
                    If x = "CE90" Then g = "ΐ"
                    If x = "CE86" Then g = "Ά"
                    If x = "CE88" Then g = "Έ"
                    If x = "CE89" Then g = "Ή"
                    If x = "CE8A" Then g = "Ί"
                    If x = "CE8C" Then g = "Ό"
                    If x = "CE8E" Then g = "Ύ"
                    If x = "CE8F" Then g = "Ώ"
                    i = i + 1
                    GoTo 10:
                    End If
                    
                    'english characters
                    If Left(x, 1) = "4" Or Left(x, 1) = "5" Or Left(x, 1) = "6" Or Left(x, 1) = "7" Then
                    If x = "41" Then g = "A"
                    If x = "42" Then g = "B"
                    If x = "43" Then g = "C"
                    If x = "44" Then g = "D"
                    If x = "45" Then g = "E"
                    If x = "46" Then g = "F"
                    If x = "47" Then g = "G"
                    If x = "48" Then g = "H"
                    If x = "49" Then g = "I"
                    If x = "4A" Then g = "J"
                    If x = "4B" Then g = "K"
                    If x = "4C" Then g = "L"
                    If x = "4D" Then g = "M"
                    If x = "4E" Then g = "N"
                    If x = "4F" Then g = "O"
                    If x = "50" Then g = "P"
                    If x = "51" Then g = "Q"
                    If x = "52" Then g = "R"
                    If x = "53" Then g = "S"
                    If x = "54" Then g = "T"
                    If x = "55" Then g = "U"
                    If x = "56" Then g = "V"
                    If x = "57" Then g = "W"
                    If x = "58" Then g = "X"
                    If x = "59" Then g = "Y"
                    If x = "5A" Then g = "Z"
                    If x = "61" Then g = "a"
                    If x = "62" Then g = "b"
                    If x = "63" Then g = "c"
                    If x = "64" Then g = "d"
                    If x = "65" Then g = "e"
                    If x = "66" Then g = "f"
                    If x = "67" Then g = "g"
                    If x = "68" Then g = "h"
                    If x = "69" Then g = "i"
                    If x = "6A" Then g = "j"
                    If x = "6B" Then g = "k"
                    If x = "6C" Then g = "l"
                    If x = "6D" Then g = "m"
                    If x = "6E" Then g = "n"
                    If x = "6F" Then g = "o"
                    If x = "70" Then g = "p"
                    If x = "71" Then g = "q"
                    If x = "72" Then g = "r"
                    If x = "73" Then g = "s"
                    If x = "74" Then g = "t"
                    If x = "75" Then g = "u"
                    If x = "76" Then g = "v"
                    If x = "77" Then g = "w"
                    If x = "78" Then g = "x"
                    If x = "79" Then g = "y"
                    If x = "7A" Then g = "z"
                    GoTo 10:
                    End If
        
                    'comma space dot etc
                    If Left(x, 1) = "2" Then
                    If x = "2E" Then g = "."
                    If x = "20" Then g = " "
                    If x = "2C" Then g = ","
                    If x = "21" Then g = "!"
                    If x = "2D" Then g = "-"
                    GoTo 10:
                    End If
                    
                    'numbers
                    If Left(x, 1) = "3" Then
                    If x = "30" Then g = "0"
                    If x = "31" Then g = "1"
                    If x = "32" Then g = "2"
                    If x = "33" Then g = "3"
                    If x = "34" Then g = "4"
                    If x = "35" Then g = "5"
                    If x = "36" Then g = "6"
                    If x = "37" Then g = "7"
                    If x = "38" Then g = "8"
                    If x = "39" Then g = "9"
                    GoTo 10:
                    End If
        
10:
str_ = str_ & g
Next i

QuotedPrintableDecode = str_
    
End Function


----------



## gvp9000

HackSlash said:


> The first thing I would do is replace the IF statements with SELECT CASE:
> 
> Select Case Statement in Excel VBA Macro Code. Alternative to Multiple If, Or, And Else Statements



Thank you for your answer, I'll have it in mind but
I need a shortest way, not to translate the string character by character ...


----------



## HackSlash

I'm not sure I understand. Your logic is sound. A computer program would have to isolate the element to translate, and convert it. Your program appears to do that. Any command that appears to be "shorter" is doing this same task in the background. You can shorten it by moving the logic to a new sub and then calling the sub from the "for\next" loop but that wouldn't change what the program is doing. Just like if there was a "translate" command it would be a sub like this.

What specifically do you mean by "shorter"? Does the program take too long to run?


----------



## thisoldman

Microsoft added the worksheet functions UNICODE and UNICHAR with Excel  2013. They are similar to the familiar CODE and CHAR functions but they work with UTF-16.

If you enter one of your hex codes in cell A1, this worksheet formula should print the correct glyph:



		Code:
__


=UNICHAR(HEX2DEC(A1)-(HEX2DEC(A1)>127)*((HEX2DEC(A1) < 53120)*51968+(HEX2DEC(A1)>=53120)*52160))


I'll leave it to others to encode the formula in VBA.


----------



## HackSlash

Looks like you can use STRCONV but the resultant code is not going to be "shorter". Only your code will appear shorter.
https://www.techonthenet.com/excel/formulas/strconv.php


If you look at how MS handles Unicode you will find that the code is very very long. There are benefits to using built-in code but it's not shorter:
https://referencesource.microsoft.com/#mscorlib/system/text/unicodeencoding.cs,e5fafda2334b6553


----------



## gvp9000

this code work on any character (need clean-up)

added to this "Free VCF file to CSV converter"
https://sourceforge.net/projects/bulkvcftocsv/
https://sourceforge.net/p/bulkvcftocsv/discussion/feedback/thread/3d176755/?limit=25

here is the file
https://dl.dropboxusercontent.com/u/57756210/VCF Import v7.xlsm



		Code:
__


'VBScript QuotedPrintableDecode decoding Function for Unicode characters
'26/11/2016 by gvp9000
Public Function QuotedPrintableDecode(SourceData)
Dim str_ As String
Dim len_ As Integer

'remove "=" and ";" from SourceData
SourceData = Replace(SourceData, "=", "")
SourceData = Replace(SourceData, ";", "")

'calculate length
len_ = Len(SourceData)

'set string ="" and flag
str_ = ""

'check characters step=2
For i = 0 To (len_ / 2 - 1)
x = Mid(SourceData, 1 + 2 * i, 2)
'x = Hex$(Val("&H" & x))

' 1 byte = 2 hex characters
'The value of each individual byte indicates its UTF-8 function, as follows:
'
'    00 to 7F hex (0 to 127): first and only byte of a sequence.
''''''''''''''    80 to BF hex (128 to 191): continuing byte in a multi-byte sequence.
'    C2 to DF hex (194 to 223): first byte of a two-byte sequence.
'    E0 to EF hex (224 to 239): first byte of a three-byte sequence.
'    F0 to FF hex (240 to 255): first byte of a four-byte sequence.

If x > "00" And x < "7F" Then
y = Mid(SourceData, 1 + 2 * i, 2)
byt_ = 1 ' eg 7F
End If

If x > "C2" And x < "DF" Then
y = Mid(SourceData, 1 + 2 * i, 4)
y1 = Mid(SourceData, 1 + 2 * i, 2)
y2 = Mid(SourceData, 1 + 2 * (i + 1), 2)
i = i + 1
byt_ = 2 ' eg C2 80
End If

If x > "E0" And x < "EF" Then
y = Mid(SourceData, 1 + 2 * i, 6)
y1 = Mid(SourceData, 1 + 2 * i, 2)
y2 = Mid(SourceData, 1 + 2 * (i + 1), 2)
y3 = Mid(SourceData, 1 + 2 * (i + 2), 2)
i = i + 2
byt_ = 3 ' eg E0 A0 80
End If

If x > "F0" And x < "FF" Then
y = Mid(SourceData, 1 + 2 * i, 8)
y1 = Mid(SourceData, 1 + 2 * i, 2)
y2 = Mid(SourceData, 1 + 2 * (i + 1), 2)
y3 = Mid(SourceData, 1 + 2 * (i + 2), 2)
y4 = Mid(SourceData, 1 + 2 * (i + 3), 2)
i = i + 3
byt_ = 4 ' eg F0 90 80 80
End If

        Select Case byt_
        Case 1
        'U = C1
                            b1 = Val("&h" & y)
                            g = b1
                            g = ChrW(g)
                            GoTo 10:
        
        Case 2
        'U = (C1 – 192) * 64 + C2 – 128
                            b1 = Val("&h" & y1)
                            b2 = Val("&h" & y2)
                            g = ChrW((b1 - 192) * 64 + b2 - 128)
                            GoTo 10:
                            
        Case 3
        'U = (C1 – 224) * 4,096 + (C2 – 128) * 64 + C3 – 128
                            b1 = Val("&h" & y1)
                            b2 = Val("&h" & y2)
                            b3 = Val("&h" & y3)
                            g = ChrW((b1 - 224) * 4096 + (b2 - 128) * 64 + b3 - 128)
                            GoTo 10:
        Case 4
        'U = (C1 – 240) * 262,144 + (C2 – 128) * 4,096 + (C3 – 128) * 64 + C4 – 128
                            b1 = Val("&h" & y1)
                            b2 = Val("&h" & y2)
                            b3 = Val("&h" & y3)
                            b4 = Val("&h" & y4)
                            g = ChrW((b1 - 240) * 262144 + (b2 - 128) * 4096 + (b3 - 128) * 64 + b4 - 128)
                            GoTo 10:
        End Select

        If fla_ = 0 Then
        MsgBox ("At least one unknown character found with UTF-8 Code = " & y)
        fla_ = 1
        End If
        
10:
str_ = str_ & g
Next i

'DecodedString = str_
QuotedPrintableDecode = str_
    
End Function


----------



## audeser

Let's debug, clean and simplify gvp9000's last post, because, so far it's the best algorithm I have found not using API calls (although StrConv only works for Latin-1 encoding (ISO-8859-1), and cannot handle strings as ChrW(38912), so that cases should relay on API):



		VBA Code:
__


Public Function Test_DecodeANSI()
'https://cp.grupo.host/index.php/knowledgebase/64/UTF-8-Encoding-Debugging-Chart.html
    Debug.Print DecodeANSI("this is a test â€“â€°â€“â€°") 'fails for VBA.ChrW(38912))
End Function

Public Function DecodeANSI(ByVal SourceData As String) As String
    Dim i As Long
    Dim thisChr As String
    Dim b() As Byte

    DecodeANSI = vbNullString
    
    '' remove "=" and ";" from SourceData
    'SourceData = VBA.Replace(SourceData, "=", "")
    'SourceData = VBA.Replace(SourceData, ";", "")
    b() = VBA.StrConv(SourceData, vbFromUnicode)

    For i = 1 To VBA.Len(SourceData) Step 2
    ' 1 byte = 2 hex characters
    ' The value of each individual byte indicates its UTF-8 function, as follows:
    '    00 to 7F hex (0   to 127): first and only byte of a sequence.
    '--> 80 to BF hex (128 to 191): continuing byte in a multi-byte sequence.
    '    C2 to DF hex (194 to 223): first byte of a two-byte sequence.
    '    E0 to EF hex (224 to 239): first byte of a three-byte sequence.
    '    F0 to FF hex (240 to 255): first byte of a four-byte sequence.
        
        b() = VBA.StrConv(VBA.Mid(SourceData, i, 1), vbFromUnicode) ' leading char...

        If b(0) >= 0 And b(0) <= 127 Then
            thisChr = VBA.ChrW(b(0))
            i = i - 1 
        
        ElseIf b(0) >= 194 And b(0) <= 223 Then
            b() = VBA.StrConv(VBA.Mid(SourceData, i, 2), vbFromUnicode)
            thisChr = VBA.ChrW((VBA.CLng(b(0)) - 192) * 64 + VBA.CLng(b(1)) - 128)

        ElseIf b(0) >= 224 And b(0) <= 239 Then
            b() = VBA.StrConv(VBA.Mid(SourceData, i, 3), vbFromUnicode)
            thisChr = VBA.ChrW((VBA.CLng(b(0)) - 224) * 4096 + (VBA.CLng(b(1)) - 128) * 64 + VBA.CLng(b(2)) - 128)
            i = i + 1

        ElseIf b(0) >= 240 And b(0) <= 255 Then
            b() = VBA.StrConv(VBA.Mid(SourceData, i, 4), vbFromUnicode)
            thisChr = VBA.ChrW(((VBA.CLng(b(0)) - 240) * 262144 + (VBA.CLng(b(1)) - 128) * 4096 + (VBA.CLng(b(2))) - 128) * 64 + VBA.CLng(b(3)) - 128)
            i = i + 2
        End If
        
        DecodeANSI = DecodeANSI & thisChr
    Next i
End Function


Have commented the "=" and ";" because it's not needed on a pure ANSI to UTF-8 conversion

Do check against chars showed here: UTF-8 Encoding Debugging Chart - Preguntas Frecuentes - FAQ - HOST - Intodomain

If needed to support other codifications, as listed here, it should go via loading strings from a file, via "Open File for Binary" and the output should be handled with WideCharToMultiByte and MultiByteToWideChar as shown here.

Hope it helps someone


----------

