Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1045

Arabic Character Encoding Issue: UTF-8 versus Windows-1256

$
0
0

Quick Background: I inherited a large SQL dump file containing a combination of English and Arabic text, and (I think) it was originally exported using 'latin1'. I changed all occurrences of 'latin1' to 'utf8' prior to importing the file. The Arabic text didn't appear correctly in phpMyAdmin (which I guess is normal), but when I loaded the text to a web page with the following, everything looked good and the arabic text displayed perfectly.:

<meta http-equiv='Content-Type' content='text/html; charset=windows-1256'/> 

Problem: My client is picky and doesn't want to change his

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

to the 'Windows-1256' equivalent. I didn't think this would be a problem, but when I changed the charset value to 'UTF-8', all the Arabic characters appeared as diamonds with question marks. Shouldn't UTF-8 display Arabic text correctly?

Here are a few notes about my database configuration:

  • Database charset is 'utf8'
  • Database connection collation is 'utf8_general_ci'
  • All databases, tables, and applicable fields have been collated as 'utf8_general_ci'

Viewing all articles
Browse latest Browse all 1045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>