News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Code pages and batch files - fun with XP

Started by jj2007, May 29, 2017, 11:45:31 AM

Previous topic - Next topic

jj2007

@echo off
echo Hello, we will try now to change the codepage to 850:
chcp 850
echo Wow, that worked! Now we'll try 1252:
chcp 1252
echo Wow, that worked also! But what about UTF-8?
chcp 65001

echo congrats!
pause


Looks straightforward, right? But it isn't... try it with XP. From a DOS prompt, please, because it will never reach the "congrats" 8)

I stumbled over this Windows bug because RichMasm had stopped working in XP. It took me quite a while to spot this exotic behaviour, now it's fixed with a switch for XP :bgrin:

P.S.: This bug affects Windows 2003 as well, see batch stops on command "chcp 65001 >NUL" - Windows2003; the suggestion to use chcp 65001 > nul && <real command here> does not work.