Any difference in MODE or CHCP when setting code page?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
CirothUngol
Posts: 46
Joined: 13 Sep 2017 18:37

Any difference in MODE or CHCP when setting code page?

#1 Post by CirothUngol » 13 Sep 2018 18:20

Just a quick question... is there any difference in using CHCP nnn or MODE CON CP SELECT=yyy when setting code pages? Perhaps one is older or more available, therefore being more compatible?

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: Any difference in MODE or CHCP when setting code page?

#2 Post by carlos » 13 Sep 2018 19:14

Only on windows 2000 and windows xp: "chcp" do a clear of the screen (like cls) after change the codepage from a double byte codepage to a single byte codepage and viceversa.
With "mode con cp select" it not happen.

Evidence:
Before change from 932 codepage to 850 using chcp :
Image
After change from 932 codepage to 850 using chcp :
Image
Before change from 932 codepage to 850 using mode :
Image
After change from 932 codepage to 850 using mode :
Image

That was the reason for choose "mode" instead "chcp" for change the codepage in the fixed genchr code: viewtopic.php?f=3&t=5326&p=56708#p56709

Similiarities: Both "chcp" and "mode" change the Input and Output Codepage, unlike old "graftabl" that change only the Output Codepage. Info: https://ss64.org/viewtopic.php?id=1622
Last edited by carlos on 13 Sep 2018 19:55, edited 8 times in total.

CirothUngol
Posts: 46
Joined: 13 Sep 2017 18:37

Re: Any difference in MODE or CHCP when setting code page?

#3 Post by CirothUngol » 13 Sep 2018 19:16

Thanks for the info Carlos, that's good enough reason to use it instead. ^_^

Post Reply