गुरुवार, 2 मई 2013

How can I enforce so Notepad++ uses UTF-8 every time I create a new file?

I have a website, I can send my turkish character with jquery ajax in firefox, but Internet explorer doesn't send my turkish character. I looked at my file that jquery ajax source file in notepad, this files codepage is ANSI.
When I convert it to UTF-8 without bom and close file, the file is again ANSI when I reopen.
How can I convert my file from ANSI to UTF-8 ?
 
 
 
 
I want to use the character encoding UTF-8 (without BOM) on my files. I can change the encoding from the "Format" menu, but it is reset every time I create a new file or open a file.
How can I do so Notepad++ uses UTF-8 (without BOM) as default encoding?

 

 
Go to
Settings -> Preferences -> New Document/ Open Save Directory
and then in
New Document -> Encoding check UTF8 without BOM

 

 

If you don't have non-ASCII characters (codepoints 128 and above) in your file, UTF-8 without BOM is the same as ASCII, byte for byte - so Notepad++ will guess wrong.
What you need to do is to specify the character encoding when serving the AJAX response - e.g. with PHP, you'd do this:
header('Content-Type: application/json; charset=utf-8');
The important part is to specify the charset with every JS response - else IE will fall back to user's system default encoding, which is wrong most of the time.

कोई टिप्पणी नहीं:

एक टिप्पणी भेजें

fly