1

When I use currency symbols, they come out wrong when I run the file. If I use £ (Alt+0163), It displays ú (Alt+163).

Any ideas???

Ian
  • 11
  • 1
  • What do you mean by _come out wrong_? On the console, in a file, text editor? ... Take a look [here](http://stackoverflow.com/questions/1259084/what-encoding-code-page-is-cmd-exe-using) for details how characters are rendered on the console – Op De Cirkel Jul 13 '11 at 20:35
  • Came out wrong on the console. – Ian Jul 14 '11 at 21:42

2 Answers2

1

This has to do with the character encodings that your text editor and your terminal are using. If what you see in your editor is not what you see in your terminal output, check the encodings used in the respective configurations. FYI for the pound sign to be at codepoint 163, you are using Windows-1252.

Ray Toal
  • 86,166
  • 18
  • 182
  • 232
1

If your command prompt is set to use Raster fonts then your command output is always interpreted using the code page of that font, which in your case is probably 850. If you change your command prompt to use a Unicode font (i.e. Lucida Console) then it will use the active code page which you can change using the chcp command.

Input to the command prompt is also interpreted as the same code page of course, so you can type in echo £>pound.txt to create pound.txt using code page 850.

Neil
  • 54,642
  • 8
  • 60
  • 72
  • I have 2 problems: 1.Notepad's font was Lucida Console when I used the symbols. 2. echo £>pound.txt didn't work either. – Ian Jul 14 '11 at 21:39
  • Notepad always uses code page 1252 whichever font you select. – Neil Jul 15 '11 at 21:04