Re: [OT] Using DIR (CMD) with redirection to a file

new topic     » goto parent     » topic index » view thread      » older message » newer message
mattlewis said...
znorq2 said...

Hi,

Norway uses the same letters as in English alphabet, with the addition to 3 extra letters - ÆØÅ.

When I try to use the DIR (Console, Windows) command with redirection to file output instead of screen, these letters come out garbled. The letters are shown correctly when displayed directly on screen.

Have you tried changing the codepage? Not sure how this might work with redirection. What are the bytes of the file? The file may be correct, but the viewer you're using may be trying a different encoding. Read the file in binary mode, and see if the bytes are what you expected.

Matt

Hi, Matt.

The current code page is 850.

Tried the following;

  1. Created a new test directory.
  2. Created a folder called "æøåÆØÅ"
  3. Opened console (cmd)
  4. CD'd to the test directory.
  5. CHCP 865 (Nordic)
  6. dir *.* /b >files.txt
  7. Content of "files.txt";
    1. files.txt
    2. ‘›†’
  8. Content presented in hex;
    1. 66,69,6C,65,73,2E,74,78,74,
    2. 0D,0A,
    3. 91,9B,86,92,9D,8F,
    4. 0D,0A
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu