I use this function to decode UTF-8:
function DecodeUTF8(s) dim i dim c dim n i = 1 do while i <= len(s) c = asc(mid(s,i,1)) if c and &H80 then n = 1 do while i + n < len(s) if (asc(mid(s,i+n,1)) and &HC0) <> &H80 then exit do end if n = n + 1 loop if n = 2 and ((c and &HE0) = &HC0) then c = asc(mid(s,i+1,1)) + &H40 * (c and &H01) else c = 191 end if s = left(s,i-1) + chr(c) + mid(s,i+n) end if i = i + 1 loop DecodeUTF8 = s end function
But there are some problems to decode these characters:
β¬, Ζ "... β β‘ β° Ε ΕΕΎΕΈ
In this case
c = 191 β c = 'ΒΏ'
I found some information related to this problem: http://www.i18nqa.com/debug/utf8-debug.html
Do you know any function for decoding correctly?
source share