I need to read data in my query with utf8 format, I tried to change collation of my SQL database when I read data base on English alphabet every thing good, but I have trouble in Arabic or other languages.
I print a string stored in variable came from in mysql query and show me like this ???????
how I can solve this problem to show them correct?
After retrieving UTF-8 strings from database, you should manually convert them to CP1256.
You can use function
str:fromutf8()
defined belowUsage is:
str:fromutf8()
-- to convert from UTF-8 to cp1256str:toutf8()
-- to convert from cp1256 to UTF-8Example: