Skip to main content
Added Windows-1270, Sami languages to the table.
Source Link

How can I make all these letters appear correctly?

How can I make all these letters appear correctly?

The problem with ANSI encoding is that – although the name suggests that it's following a standard – it is conditional on what natural language the text is written in. 
In the case of Swedish/Scandinavian, or even all Western European    (Latin) languages,
  "ANSI" encoding means the code page Windows-1252. 1

VS Code correctly guesses the encoding is Windows 1252.VS Code correctly guesses the encoding is Windows 1252.

Click Windows 1252 > Save with Encoding.Click Windows 1252 > Save with Encoding.

Click on UTF-8.Click on UTF-8.

To achieve this, you need to enable the Auto Guess Encoding feature of VS Code. 
Press Ctrl+,   2 (comma) and paste or type    autoGuessEncoding. 2 Check the box where it says : 
"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only Files: Encoding is respected." 3

Check the box if you want VS Code to auto-guess the encoding.Check the box to make VS Code to auto-guess the encoding.

Searching the internet, trying to find out what "ANSI" means in the the context of encoding, will likely encoding may cause confusion.

You
You might encounter that ANSI is "a misnomer", which is true but, not of much practical help.

I believe that whatWhat clears up the confusion is to realize that when Microsoft Microsoft writes "ANSI" "ANSI" in the status bar of notepad.exe, it typicallyit typically means Windows-1252.
  For other natural languages, "ANSI" means the code page Windows-125x other than Western European, where x is number 0-8, as shown insee the table below.

Other
Other well-known text editors, such as Notepad++, have picked upadopted this convention and also write "ANSI" in the status bar.

Windows-1252 is sometimes called code page 1252 or CP-1252.
Likewise Likewise for the other code pages.

ANSI encoding Language/Alphabet
Windows-1250 Slavic languages – Latin alphabet (e.g. Polish)
Windows-1251 Slavic languages – Cyrillic alphabet (e.g. Ukrainian)
Windows-1252 Western European languages (French, German, Scandinavian, Spanish, Swahili …)
Windows-1253 Greek
Windows-1254 Turkish, Latin Azeri, and Latin Uzbek
Windows-1255 Hebrew
Windows-1256 Arabic, Farsi, Urdu
Windows-1257 Baltic languages: Estonian, Latvian, Lithuanian
Windows-1258 Vietnamese
Windows-1270Sami languages

How can I make all these letters appear correctly?

The problem with ANSI encoding is that – although the name suggests that it's following a standard – it is conditional on what natural language the text is written in.
In the case of Swedish/Scandinavian, or even all Western European  (Latin) languages,
  "ANSI" encoding means the code page Windows-1252. 1

VS Code correctly guesses the encoding is Windows 1252.

Click Windows 1252 > Save with Encoding.

Click on UTF-8.

To achieve this, you need to enable the Auto Guess Encoding feature of VS Code.
Press Ctrl+,  (comma) and paste or type  autoGuessEncoding. 2 Check the box where it says :
"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only Files: Encoding is respected." 3

Check the box if you want VS Code to auto-guess the encoding.

Searching the internet, trying to find out what "ANSI" means in the context of encoding, will likely cause confusion.

You might encounter that ANSI is "a misnomer", which is true but not of much practical help.

I believe that what clears up the confusion is to realize that when Microsoft writes "ANSI" in the status bar of notepad.exe, it typically means Windows-1252.
  For other natural languages, "ANSI" means the code page Windows-125x, where x is number 0-8, as shown in the table below.

Other well-known text editors, such as Notepad++, have picked up this convention and also write "ANSI" in the status bar.

Windows-1252 is sometimes called code page 1252 or CP-1252.
Likewise for the other code pages.

ANSI encoding Language/Alphabet
Windows-1250 Slavic languages – Latin alphabet (e.g. Polish)
Windows-1251 Slavic languages – Cyrillic alphabet (e.g. Ukrainian)
Windows-1252 Western European languages (French, German, Scandinavian, Spanish, Swahili …)
Windows-1253 Greek
Windows-1254 Turkish, Latin Azeri, and Latin Uzbek
Windows-1255 Hebrew
Windows-1256 Arabic, Farsi, Urdu
Windows-1257 Baltic languages: Estonian, Latvian, Lithuanian
Windows-1258 Vietnamese

How can I make all these letters appear correctly?

The problem with ANSI encoding is that – although the name suggests that it's following a standard – it is conditional on what natural language the text is written in. 
In the case of Western European  (Latin) languages, "ANSI" encoding means the code page Windows-1252. 1

VS Code correctly guesses the encoding is Windows 1252.

Click Windows 1252 > Save with Encoding.

Click on UTF-8.

To achieve this, you need to enable the Auto Guess Encoding feature of VS Code. 
Press Ctrl+, 2 (comma) and paste or type  autoGuessEncoding. Check the box where it says : 
"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only Files: Encoding is respected." 3

Check the box to make VS Code to auto-guess the encoding.

Searching the internet to find out what "ANSI" means in the context of encoding may cause confusion.
You might encounter that ANSI is "a misnomer", which is true but, not of much practical help.

What clears up the confusion is to realize that when Microsoft writes "ANSI" in the status bar of notepad.exe, it typically means Windows-1252. For natural languages other than Western European, see the table below.
Other well-known text editors, such as Notepad++, have adopted this convention and also write "ANSI" in the status bar.

Windows-1252 is sometimes called code page 1252 or CP-1252. Likewise for the other code pages.

ANSI encoding Language/Alphabet
Windows-1250 Slavic languages – Latin alphabet (e.g. Polish)
Windows-1251 Slavic languages – Cyrillic alphabet (e.g. Ukrainian)
Windows-1252 Western European languages (French, German, Scandinavian, Spanish, Swahili …)
Windows-1253 Greek
Windows-1254 Turkish, Latin Azeri, and Latin Uzbek
Windows-1255 Hebrew
Windows-1256 Arabic, Farsi, Urdu
Windows-1257 Baltic languages: Estonian, Latvian, Lithuanian
Windows-1258 Vietnamese
Windows-1270Sami languages
Mainly additions to Section 3 on the confusion about what "ANSI" means.
Source Link

You haveI can think of two options :

  1. Convert the file to UTF-8UTF-8. – This is what I recommend.
  2. Configure VS Code to auto-detect the most proper encoding.

The acronym ANSIANSI stands for American National Standards Institute.

The problem with ANSIANSI encoding is that – although the name suggests that it's following a standard – it's it is conditional on on what natural language yourthe text is written in. 
In the case of Swedish/Scandinavian, or even all Western European (Latin) languages, "ANSI"
"ANSI" encoding means the code page Windows-1252Windows-1252. 1

So, inIn VS Code, instead of looking for ANSI encoding, you should look for Windows-1252.
If you clickI clicked UTF-8 > Reopen with Encoding, then expectand VS Code to displaydisplayed
"Western (Windows 1252) Guessed from content" as its top suggestion.

VS Code correctly guesses on Windows 1252 encoding.VS Code correctly guesses the encoding is Windows 1252.

Otherwise, it now remains to convert the file to UTF-8UTF-8 encoding.

Click on UTF-8.Click on UTF-8.

This converts the file's non-ASCII characters to UTF-8 UTF-8 and encodes theencodes the file as UTF-8UTF-8.

If you don't want to convert to UTF-8UTF-8, and if you experience this problem over and over again –this problem every time you open another file – you may prefer to set VS Code to always auto-guess the encoding.

3. A table showing ANSI (Windows)The confusion about what "ANSI" encoding → language/alphabetmeans

Searching the internet, trying to find out what "ANSI" means in the context of encoding, will likely cause confusion.

You might encounter that ANSI is "a misnomer", which is true but not of much practical help.

I believe that what clears up the confusion is to realize that when Microsoft writes "ANSI" in the status bar of notepad.exe, it typically means Windows-1252.
For other natural languages, "ANSI" means the code page Windows-125x, where x is number 0-8, as shown in the table below.

Other well-known text editors, such as Notepad++, have picked up this convention and also write "ANSI" in the status bar.

Windows-1252 is sometimes called code page 1252 or CP-1252.
Likewise for the other code pages.

ANSIANSI encoding Language/Alphabet
Windows-1250 Slavic languages – Latin alphabet (e.g. Polish)
Windows-1251 Slavic languages – Cyrillic alphabet (e.g. Ukrainian)
Windows-1252 Western European languages (French, German, Scandinavian, Spanish, Swahili …)
Windows-1253 Greek
Windows-1254 Turkish, Latin Azeri, and Latin Uzbek
Windows-1255 Hebrew
Windows-1256 Arabic, Farsi, Urdu
Windows-1257 Baltic languages: Estonian, Latvian, Lithuanian
Windows-1258 Vietnamese

1 For a list of what "ANSI" could mean, see the table in Section 3.

2 On macOS, press instead of Ctrl. For Linux users, "ANSI" typically means Windows-1252 – just as on Windows.
For macOS users, try to see what VS Code suggests as Guessed from content.
Or else have a look at Macintosh emulation code pages at Wikipedia.

3 FromSee the default settings in VS Code.

You have two options :

  1. Convert the file to UTF-8. – This is what I recommend.
  2. Configure VS Code to auto-detect the most proper encoding.

The acronym ANSI stands for American National Standards Institute.

The problem with ANSI encoding is that – although a standard – it's conditional on what natural language your text is written in. In the case of Swedish/Scandinavian, or even all Western European (Latin) languages, "ANSI" means Windows-1252. 1

So, in VS Code, instead of looking for ANSI encoding, you should look for Windows-1252.
If you click UTF-8 > Reopen with Encoding, then expect VS Code to display
"Western (Windows 1252) Guessed from content" as its top suggestion.

VS Code correctly guesses on Windows 1252 encoding.

Otherwise, it now remains to convert the file to UTF-8 encoding.

Click on UTF-8.

This converts the file's non-ASCII characters to UTF-8 and encodes the file as UTF-8.

If you don't want to convert to UTF-8, and if you experience this problem over and over again – every time you open another file – you may prefer to set VS Code to always auto-guess the encoding.

3. A table showing ANSI (Windows) encoding → language/alphabet

ANSI encoding Language/Alphabet
Windows-1250 Slavic languages – Latin alphabet (e.g. Polish)
Windows-1251 Slavic languages – Cyrillic alphabet (e.g. Ukrainian)
Windows-1252 Western European languages (French, German, Scandinavian, Spanish, Swahili …)
Windows-1253 Greek
Windows-1254 Turkish, Latin Azeri, and Latin Uzbek
Windows-1255 Hebrew
Windows-1256 Arabic, Farsi, Urdu
Windows-1257 Baltic languages: Estonian, Latvian, Lithuanian
Windows-1258 Vietnamese

1 For a list of what "ANSI" could mean, see the table in Section 3.

2 On macOS, press instead of Ctrl. For Linux users, "ANSI" typically means Windows-1252 – just as on Windows.
For macOS users, try to see what VS Code suggests as Guessed from content.
Or else have a look at Macintosh emulation code pages at Wikipedia.

3 From the default settings in VS Code.

I can think of two options :

  1. Convert the file to UTF-8. – This is what I recommend.
  2. Configure VS Code to auto-detect the most proper encoding.

The acronym ANSI stands for American National Standards Institute.

The problem with ANSI encoding is that – although the name suggests that it's following a standard – it is conditional on what natural language the text is written in. 
In the case of Swedish/Scandinavian, or even all Western European (Latin) languages,
"ANSI" encoding means the code page Windows-1252. 1

In VS Code, instead of looking for ANSI encoding, look for Windows-1252.
I clicked UTF-8 > Reopen with Encoding, and VS Code displayed
"Western (Windows 1252) Guessed from content" as its top suggestion.

VS Code correctly guesses the encoding is Windows 1252.

Otherwise, it remains to convert the file to UTF-8 encoding.

Click on UTF-8.

This converts the file's non-ASCII characters to UTF-8 and encodes the file as UTF-8.

If you don't want to convert to UTF-8, and if you experience this problem every time you open another file – you may prefer to set VS Code to always auto-guess the encoding.

3. The confusion about what "ANSI" encoding means

Searching the internet, trying to find out what "ANSI" means in the context of encoding, will likely cause confusion.

You might encounter that ANSI is "a misnomer", which is true but not of much practical help.

I believe that what clears up the confusion is to realize that when Microsoft writes "ANSI" in the status bar of notepad.exe, it typically means Windows-1252.
For other natural languages, "ANSI" means the code page Windows-125x, where x is number 0-8, as shown in the table below.

Other well-known text editors, such as Notepad++, have picked up this convention and also write "ANSI" in the status bar.

Windows-1252 is sometimes called code page 1252 or CP-1252.
Likewise for the other code pages.

ANSI encoding Language/Alphabet
Windows-1250 Slavic languages – Latin alphabet (e.g. Polish)
Windows-1251 Slavic languages – Cyrillic alphabet (e.g. Ukrainian)
Windows-1252 Western European languages (French, German, Scandinavian, Spanish, Swahili …)
Windows-1253 Greek
Windows-1254 Turkish, Latin Azeri, and Latin Uzbek
Windows-1255 Hebrew
Windows-1256 Arabic, Farsi, Urdu
Windows-1257 Baltic languages: Estonian, Latvian, Lithuanian
Windows-1258 Vietnamese

1 For a list of what "ANSI" could mean, see the table in Section 3.

2 On macOS, press instead of Ctrl. For Linux users, "ANSI" typically means Windows-1252 – just as on Windows.
For macOS users, try to see what VS Code suggests as Guessed from content.
Or else have a look at Macintosh emulation code pages at Wikipedia.

3 See the default settings in VS Code.

Minor clarifications.
Source Link

So, in VS Code, instead of looking for ANSI encoding, you should look forlook for Windows-1252.
If you click UTF-8 > Reopen with Encoding, then expect VS Code to display
"Western (Windows 1252) Guessed from content" as its top suggestion.

If^ click to enlarge

VS Code correctly guessed the encoding Windows 1252.
If you don'tdon't want to change the encoding, you're now all set and done.

Now click on UTF-8."UTF-8 utf8" :

Click on UTF-8.

This converts the file's encodingnon-ASCII characters to UTF-8 :

Click on UTF-8.and encodes the file as UTF-8.

If you don'tdon't want to convert to UTF-8, and if you experience this problem over and over again – every time you open another file, you may prefer to haveset VS Code to always auto-guess the encoding.

To achieve this, you need to enable the Auto Guess Encoding feature of VS Code. 
Press Ctrl+, (comma) and paste or type autoGuessEncoding. 2 Check the box where it says :
"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only Files: Encoding is respected." 3

3. A table showing ANSI (Windows) encoding → language/alphabet

ANSI encoding Language/Alphabet
Windows-1250 Slavic languages – Latin alphabet (e.g. Polish)
Windows-1251 Slavic languages – Cyrillic alphabet (e.g. Ukrainian)
Windows-1252 Western European languages (Afrikaans, FrenchFrench, German, Scandinavian, Spanish, Swahili …)
Windows-1253 Greek
Windows-1254 Turkish, Latin Azeri, and Latin Uzbek
Windows-1255 Hebrew
Windows-1256 Arabic, Farsi, Urdu
Windows-1257 Baltic languages: Estonian, Latvian, Lithuanian
Windows-1258 Vietnamese

1 For a list of what "ANSI" could mean, see the table in Section 3.

2 On macOS, press instead of Ctrl. For Linux users, "ANSI" typically means Windows-1252 – just as on Windows. 
For macOS users, I don't have any experiencetry to share, but I suggestsee what VS Code suggests as havingGuessed from content.
Or else have a look at Macintosh emulation code pages, at Wikipedia.

3 SeeFrom the default settings in VS Code.

So, in VS Code, instead of looking for ANSI encoding, you should look for Windows-1252.

If you don't want to change the encoding, you're now all set and done.

Now click on UTF-8. This converts the file's encoding to UTF-8 :

Click on UTF-8.

If you don't want to convert to UTF-8, and if you experience this problem over and over again – every time you open another file, you may prefer to have VS Code always auto-guess the encoding.

To achieve this, you need to enable the Auto Guess Encoding feature of VS Code. Press Ctrl+, and paste or type autoGuessEncoding. 2 Check the box where it says :
"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only Files: Encoding is respected." 3

3. A table showing ANSI encoding → language/alphabet

ANSI encoding Language/Alphabet
Windows-1250 Slavic languages – Latin alphabet (e.g. Polish)
Windows-1251 Slavic languages – Cyrillic alphabet (e.g. Ukrainian)
Windows-1252 Western European languages (Afrikaans, French, German, Scandinavian, Spanish, Swahili …)
Windows-1253 Greek
Windows-1254 Turkish, Latin Azeri, and Latin Uzbek
Windows-1255 Hebrew
Windows-1256 Arabic, Farsi, Urdu
Windows-1257 Baltic languages: Estonian, Latvian, Lithuanian
Windows-1258 Vietnamese

1 For a list of what "ANSI" could mean, see the table in Section 3.

2 On macOS, press instead of Ctrl. For macOS users, I don't have any experience to share, but I suggest having a look at Macintosh emulation code pages, Wikipedia.

3 See the default settings in VS Code.

So, in VS Code, instead of looking for ANSI encoding, you should look for Windows-1252.
If you click UTF-8 > Reopen with Encoding, then expect VS Code to display
"Western (Windows 1252) Guessed from content" as its top suggestion.

^ click to enlarge

VS Code correctly guessed the encoding Windows 1252.
If you don't want to change the encoding, you're now all set and done.

Now click on "UTF-8 utf8" :

Click on UTF-8.

This converts the file's non-ASCII characters to UTF-8 and encodes the file as UTF-8.

If you don't want to convert to UTF-8, and if you experience this problem over and over again – every time you open another file you may prefer to set VS Code to always auto-guess the encoding.

To achieve this, you need to enable the Auto Guess Encoding feature of VS Code. 
Press Ctrl+, (comma) and paste or type autoGuessEncoding. 2 Check the box where it says :
"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only Files: Encoding is respected." 3

3. A table showing ANSI (Windows) encoding → language/alphabet

ANSI encoding Language/Alphabet
Windows-1250 Slavic languages – Latin alphabet (e.g. Polish)
Windows-1251 Slavic languages – Cyrillic alphabet (e.g. Ukrainian)
Windows-1252 Western European languages (French, German, Scandinavian, Spanish, Swahili …)
Windows-1253 Greek
Windows-1254 Turkish, Latin Azeri, and Latin Uzbek
Windows-1255 Hebrew
Windows-1256 Arabic, Farsi, Urdu
Windows-1257 Baltic languages: Estonian, Latvian, Lithuanian
Windows-1258 Vietnamese

1 For a list of what "ANSI" could mean, see the table in Section 3.

2 On macOS, press instead of Ctrl. For Linux users, "ANSI" typically means Windows-1252 – just as on Windows. 
For macOS users, try to see what VS Code suggests as Guessed from content.
Or else have a look at Macintosh emulation code pages at Wikipedia.

3 From the default settings in VS Code.

Adding a few references.
Source Link
Loading
Source Link
Loading