How to convert Unicode NCR form to its original form in PHP? -
To avoid "monster characters", I want to store Unicode NCR form in non-English letters in the database (MySQL) Choose for However, the PDF plugin I use (FPDF) does not accept the Unicode NCR form as the correct format; It directly displays the data:
and # 36889; & Amp; # 20491; & Amp; # 19968; & # 20491; & Amp; # 20363; & Amp; # 23376;
But I want to show it:
這個 一個 例子
Is there any way to convert Unicode NCR form to its original form? ?
ps is the meaning of the sentence "This is an example" in traditional Chinese.
p.s I know the NCR destroys the farm's storage space, but it is the safest way to store non-English letters. correct me if I am wrong. Thank you.
PHP is a simple solution using the mbstring extension.
The 'utf8_entity_decode' function is from PHP.net (Andrew Simpson):. I changed the code a bit to avoid degraded 'A'-modifier inside Regex.
Comments
Post a Comment