Wednesday, July 30, 2008

encoding UTF-8 / Unicode how to save as


click the image to see the full size

When you need to save a html/ other text file with accents/ special characters like á can use text pad and use the save as dialog to choose the Encoding and choose UTF-8
See attached image TextPad_SaveAs_Encoding.JPG for a sample of the textpad encoding type in the save as dialog.
 
Also the html file needs to have the following meta header in the <head> section:

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

Tech Note:

In PHP code need to use the mb_ functions like mb_substr mb_ stands for multi byte functions. You need to replace these functions in other places where you use strings that might be multi byte like substr is replaced with mb_substr, mb_ send_ mail to send multi byte emails (that may have unicode characters in the text or subject), etc

No comments: