You are not logged in.

#1 22 Nov 2015 19:04

Giacomo
Member
From: Italy
Registered: 20 Oct 2011
Posts: 42

Visual oddity in MS-DOS Editor

Hello, in Windows XP Professional service pack 3 italian

Microsoft Windows XP [Versione 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

if I use the following sequence of commands:

C:\Documents and Settings\Giacomo>edit

C:\DOCUME~1\Giacomo>chcp 1252
Tabella codici attiva: 1252

C:\DOCUME~1\Giacomo>edit

then I get the following strange sequence of characters:

OŠ÷‹-¢ÿ-¢¸mŸè‚ ÇG  ‰Oˆw‹6±¤‰76Ÿ+÷‰w‹65¥‰w  ‹÷‹>±¤ùÿ0£}
                                              - 1252,

C:\DOCUME~1\Giacomo>

Additional notes:
1. I opened the command prompt and then I run the first command, no other commands before the first "edit";
2. if I skip the first "edit" then I will not get the odd sequence of characters;
3. nothing written in both the edit sessions, the editor was just closed after I opened it;
4. before switching to the new code page, the system code page is 850

C:\Documents and Settings\Giacomo>chcp
Tabella codici attiva: 850

5. the pasted text is not rendered as I can see in the prompt, because of this I will attach an image
chcp_and_edit_strange_result.png
Do you have any clue about the reason of this strange behaviour?
Can you reproduce it in other Windows versions or system language?

Offline

#2 22 Nov 2015 19:36

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: Visual oddity in MS-DOS Editor

What you are running into is a side effect of Extended ASCII, the characters displayed can change depending on your code page or the machine you happen to be using.

This is why everything has moved to unicode, unicode text will display the same everywhere.

Offline

#3 23 Nov 2015 12:08

Giacomo
Member
From: Italy
Registered: 20 Oct 2011
Posts: 42

Re: Visual oddity in MS-DOS Editor

Thanks Simon, you are right: if I use a different code page the message is different.
In example:

Microsoft Windows XP [Versione 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Giacomo>edit

C:\DOCUME~1\Giacomo>chcp 852
Tabella codici attiva: 852

C:\DOCUME~1\Giacomo>edit
Una o piŚ tabelle codici di CON non valide per il codice tastiera immesso

C:\DOCUME~1\Giacomo>

Again, if I copy paste the text is not the same, in the command prompt I can read "più" and not "piŚ".

Offline

Board footer

Powered by