Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert an ANSI encoded file to UTF-8 with Notepad++? [closed]

I have a website, and I can send my Turkish characters with jQuery in Firefox, but Internet Explorer doesn't send my Turkish characters. I looked at my source file in notepad, and this file's code page is ANSI.

When I convert it to UTF-8 without BOM and close the file, the file is again ANSI when I reopen.

How can I convert my file from ANSI to UTF-8?

like image 775
Kerem Bekman Avatar asked Aug 31 '11 11:08

Kerem Bekman


People also ask

How do I change the encoding to UTF-8 in Notepad?

Download and install this powerful free text editor: Notepad++ Open the file you want to verify/fix in Notepad++ In the top menu select Encoding > Convert to UTF-8 (option without BOM) Save the file.

What is ANSI encoding in Notepad?

ANSI and UTF-8 are two types of text encoding. The former is the default encoding that is used when you save text files created in Notepad, the text editor included in the Windows operating system.


1 Answers

Regarding this part:

When I convert it to UTF-8 without bom and close file, the file is again ANSI when I reopen.

The easiest solution is to avoid the problem entirely by properly configuring Notepad++.

Try Settings -> Preferences -> New document -> Encoding -> choose UTF-8 without BOM, and check Apply to opened ANSI files.

notepad++ UTF-8 apply to opened ANSI files

That way all the opened ANSI files will be treated as UTF-8 without BOM.

For explanation what's going on, read the comments below this answer.

To fully learn about Unicode and UTF-8, read this excellent article from Joel Spolsky.

like image 155
jakub.g Avatar answered Oct 12 '22 22:10

jakub.g