วันเสาร์ที่ 14 พฤศจิกายน พ.ศ. 2558

How to save files with UTF-8 encoding on Mac



The above figure shows the problem that some Thai characters are not comprehensible when the HTML file containing JQuery and JavaScript file is not saved with encoding UTF-8.

I have tried TextEdit by going to TextEdit > Preferences… > Open and Save, and choosing the Save As setting is “Unicode (UTF-8)”.  However, somehow my JQuery and JavaScript code in the file disappeared.  I need to rewrite the code :(  I have also tried TextWrangler and used menu File > Save as, and then chose Encoding as "Unicode (UTF-8)" but this approach did not work either.

Finally, I found the solution by using Sublime Text with the menu File > Save with Encoding.  Then chose the encoding value as "UTF-8 with BOM"




ไม่มีความคิดเห็น:

แสดงความคิดเห็น