View Single Post
  #10 (permalink)  
Old December 7th, 2015, 05:27 AM
vsrawat vsrawat is offline
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Yes, I worked perfectly. Thanks a million.

Quote:
Originally Posted by march11 View Post
You try this snippet of code it worked for me....

Code:
Function UTF8_Decode(ByVal sStr As String)
    Dim l As Long, sUTF8 As String, iChar As Integer, iChar2 As Integer
    For l = 1 To Len(sStr)
        iChar = Asc(Mid(sStr, l, 1))
        If iChar > 127 Then
            If Not iChar And 32 Then ' 2 chars
            iChar2 = Asc(Mid(sStr, l + 1, 1))
            sUTF8 = sUTF8 & ChrW$(((31 And iChar) * 64 + (63 And iChar2)))
            l = l + 1
        Else
            Dim iChar3 As Integer
            iChar2 = Asc(Mid(sStr, l + 1, 1))
            iChar3 = Asc(Mid(sStr, l + 2, 1))
            sUTF8 = sUTF8 & ChrW$(((iChar And 15) * 16 * 256) + ((iChar2 And 63) * 64) + (iChar3 And 63))
            l = l + 2
        End If
            Else
            sUTF8 = sUTF8 & Chr$(iChar)
        End If
    Next l
    UTF8_Decode = sUTF8
End Function
Yes, This code worked perfectly.

I had been stuck for several days trying to read Hindi devanagari unicode characters from a tab delimited file into vba7 ms word 1020 on w8-32 bit.

Had spend several hours searching everywhere on net.

Then I found your code, and it did the trick.

My this problem is fully and perfectly solved.

May God bless you.

Thanks a million.
--
Rawat
India
Reply With Quote