Answer to Question #48265 in AJAX | JavaScript | HTML | PHP for amirreza

Question #48265
I'm using engine but this script just the English language displays correctly and in other languages, such as Persian and Spanish shows a peculiar shape (like this : "اخباØ") please help me.
1
Expert's answer
2014-10-28T01:40:53-0400
Answer
Ifyou are using engine, please check encoding that is enabled in your engine.
It's recommended you to use “UTF-8” (it also can be named like “utf-8” or
“unicode-8” in different scripts).
Alsoit recommended to use “mb_” functions to do operations with strings. To set
encoding in php script please use next function:
mb_internal_encoding('utf');
Also you can add charset to HTTP-headers:
header('Content-type:text/plain; charset=utf-8');
Also, if you usesdatabase, please set same encoding in requests as in engine, for example:
mysql> SET NAMES utf8;
Ishould say that very important that the system must support necessary to you
encoding.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS