Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UTF-8 Encoding

Status
Not open for further replies.

ipazzo

Programmer
Jan 17, 2002
69
IT
Please help ME!!!!

I have VFP6 and i need a function to encode/decode strings from/to UNICODE and UTF-8.
Anyone can help me.

Thanks.


 
Hi AirCon,

i have solved the problem writting my own UTF8 encoding routine. It wasn't so hard.


func utf8encode( lcString )
local lcUtf, i

lcUtf = ""
for i = 1 to len(lcString)
c = asc(substr(lcString,i,1))
if c < 128
cUtf = cUtf+chr(c)
else
cUtf = cUtf+chr(bitor(192,bitrshift(c,6)))+chr(bitor(128,bitand(c,63)))
endif
next

return cUtf

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top