0

I have a MySQL database in a Linux server , character-set=utf8 collation=utf8_unicode_ci .. write/read Arabic characters with php is fine , no issues ever .. however when reading the database data directly from the server using webmin it shows something like this : ال٠..... anyway , I didn't care about that cause reading/writng in Arabic from php was perfect ..

now I'm trying to read with VB.net .. connecting like this :

MySqlConnection.ConnectionString = "server=x.x.x.x; user id=xx; password=xx; database=xx; CharSet=utf8 "

the output is like this :الموضو trying many solutions like :

bytes = Encoding.Default.GetBytes(result)
arabic= Encoding.GetEncoding(xxxx).GetString(bytes)

without any success !!! I need help please ..

1 Answers1

0

SOLVED BY :

bytes = Encoding.Convert(Encoding.UTF8, Encoding.GetEncoding("UTF-16BE"), Encoding.Default.GetBytes(ids))
arabic = Encoding.GetEncoding("UTF-16BE").GetString(bytes)
  • You should not need any form of 'convert'. See "Mojibake" in https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Nov 19 '18 at 03:48