3

For school we are forced to write a small program in BASIC or "any other language" so I will be doing it in PHP.

I have to run it through command prompt, so thought I'd make a few improvements to the "UI" of the shell with lines etc. I used ALT+nnn to insert them into my code, but when I execute it in the shell I get weird characters in it's place.

Does anyone know how to fix this?

Thanks

Joshua
  • 906
  • 5
  • 12
  • 23

1 Answers1

0

From this SO thread

  • switch font to Lucida
  • then to switch shell code page to UTF-8, type:

    chcp 65001

This seems to be very buggy on Windows, so you are maybe better with codes like 850 (Latin-1, the MS-DOS equivalent of 1252 in Windows). I mean chcp 850.

Community
  • 1
  • 1
FelipeAls
  • 21,711
  • 8
  • 54
  • 74
  • I have done this, but as soon as I tried to run the program I get an error telling me "-f" isn't a internal or ext. command. Can you please tell me how to reset it back to ASCII please? I guess my teacher will just have to make do with an ugly "UI". – Joshua Feb 19 '13 at 19:58
  • Try `chcp 437`, should be `US-ASCII`. – FelipeAls Feb 19 '13 at 20:02
  • Thank you for your help. Not to worry, it's only a small program for a school and nothing a client will ever see! – Joshua Feb 19 '13 at 20:02
  • Did you try `chcp 1252`? Seems to work for another SO user: http://stackoverflow.com/a/1650454/137626 and after all `cmd` is a Windows shell running in Windows, not MS-DOS 7 or whatever. – FelipeAls Feb 19 '13 at 20:07
  • Something is seriously up with my cmd.exe now it doesn't recognize that command (CHCP) or php.exe. I will have to do some digging. – Joshua Feb 19 '13 at 21:18