QB / QB64 Discussion Forum      Other Subforums, Links and Downloads      Archived Pascal Resources    Search


by Michael Calkins (Login MCalkins)
ASM Forum

cp437 is what Character Map calls "DOS: United States" and what Qbasic calls ASCII. Windows-1252 is what Character Map calls "Windows: Western".

No-Break Space, " ", is unicode character 0x00a0, cp437 encoding 0xff, windows-1252 encoding 0xa0, utf-8 encoding 0xc2,0xa0. You can get it by typing Alt+0160 or Alt+255.

Latin Small Letter A With Acute, "á", is unicode character 0x00e1, cp437 encoding 0xa0, windows-1252 encoding 0xe1, utf-8 encoding 0xc2,0xe1. You can get it by typing Alt+0225 or Alt+160.

Latin Small Letter Y With Diaeresis, "ÿ", is unicode character 0x00ff, cp437 encoding 0x98, windows-1252 encoding 0xff, utf-8 encoding 0xc2,0xff. You can get it by typing Alt+0255 or Alt+152.

If you save a text file in cp437, and open it in windows-1252, " " will show up as "ÿ".

If you save a text file in windows-1252, and open it in cp437, " " will show up as "á".

If you save a text file in utf-8, and open it in cp437, " " will show up as chr$(&hc2)+"á".

Notepad can save in windows-1252 and utf-8, but not in cp437. Notepad saves a byte order mark (cp437: chr$(&hef)+chr$(&hbb)+chr$(&hbf)) to utf8 files, even though endianness doesn't matter in utf-8, but this seems to allow Notepad to distinguish a utf-8 file from an ansi file.

Qbasic and ms-dos Editor use cp437 exclusively.


P.S. When I posted, some characters got changed into "&#nnnn;" type stuff, so I replaced them with chr$(&h) to indicate the cp437 displayable character.


You can think of Unicode and ASCII as character sets, and cp437, utf-8, and windows-1252 as encodings.

This message has been edited by MCalkins on Feb 12, 2011 9:16 PM

Posted on Feb 12, 2011, 8:46 PM

Respond to this message   

Return to Index

 Copyright © 1999-2018 Network54. All rights reserved.   Terms of Use   Privacy Statement