CMD cannot read Danish characters when I execute the .bat file

I am making a simple batch file, but CMD cannot read Danish characters when executing a .bat file. It shows strange characters like ├ª├ © ├ instead of ÆØÅ. If I type echo æøådirectly into CMD, it shows æøå Something is wrong with my computer?

0
source share
2 answers

Use chcp to manage your code page.

As Mofi , by indicating the following, you will help your cause:

chcp 1252

Use this line of code before printing echo æøå.

0
source

, . æøå .

, bat cmd , Windows, png PNG, / ..

, , 1 (= 8 ) , 2 , UTF-16 1 4 , UTF-8.

1 , 2 ^ 8 = 256 , , .

. , , ,

  • decimal: 248
  • : F8
  • binary: 1111 1000

CHCP ( ), - , , Windows .

Windows, , .

OEM 850 OEM 865 , , , OEM 861.

, Unicode, Windows-1252 GUI , .

echo æøå *.bat?

  • Windows-1252 1 .
    hexadecimal: 65 63 68 6F 20 E6 F8 E5
  • OEM 865 OEM 850 1 .
    hexadecimal: 65 63 68 6F 20 91 9B 86
  • UTF-8 (BOM) 1 2 .
    hexadecimal: 65 63 68 6F 20 C3 A6 C3 B8 C3 A5
  • UTF-16 (BOM) 2 . hexadecimal: FF FE 65 00 63 00 68 00 6F 00 20 00 E6 00 F8 00 E5 00
  • .

├ª├©├Ñ - , UTF-8, 6 OEM 865 C3 A6 C3 B8 C3 A5.

Unicode UTF-8 ANSI. ANSI, Windows-1252 , ANSI - , ANSI Windows 1 . E6 F8 E5 .

Windows-1252 µ°Õ.

, ANSI OEM, Windows-1252 OEM 865 OEM 850. 91 9B 86, Windows-1252 ( ) ‘›†.

æøå , 850 , - , Windows.

Windows-1252 ECHO:

chcp 1252

, , Windows-1252. , Windows (7, Vista, XP) a href= "https://en.wikipedia.org/wiki/Terminal_(typeface)" rel= "nofollow noreferrer" > Terminal , 1252 , Windows-1252, echo æøå µ°Õ, - 1252. , , .

+1

Source: https://habr.com/ru/post/1678241/


All Articles