flat assembler
Message board for the users of flat assembler.

Index > Windows > what is code page?

Author
Thread Post new topic Reply to topic
b1528932



Joined: 21 May 2010
Posts: 287
b1528932 16 Oct 2010, 14:01
I cant understand concept of code page.

For me, code page is set of 256 characters (quoted from msdn).

If i want to output character XX, function lookup its position in the table and draw corresponding glyph. This is by using ansi functions (xxxA). Wheni use unicode function, always get same glyph for character.


Qs:
- what is the purpose of code page in console input buffer?
- does unicode functions (xxxW) use code pages?
Post 16 Oct 2010, 14:01
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 16 Oct 2010, 16:42
b1528932,

Console input code pade tells you how to interpret KEY_EVENT_RECORD.uChar.AsciiChar field from ReadConsoleInputA() for values outside ASCII range. There are multi-byte character sets too: Japanese Shift-JIS, Chinese Big5 and GBK, for example.

xxxW functions use UTF-16 LE encoding (code page 1200) which uses surrogate pairs to represent some Unicode code points. It can be seen as they use one codepage.
Post 16 Oct 2010, 16:42
View user's profile Send private message Reply with quote
b1528932



Joined: 21 May 2010
Posts: 287
b1528932 16 Oct 2010, 20:53
Ok, so how actually goes this translation?

I want to output ascii 0x90.
xxA function convert it into utf16 character using code page, then write proper data into CHAR_INFO.

when i use xxW function, there is no translation at all, data just go as i input?

same for input, just lower layer receive KEY_EVENT_RECORD.uChar.UnicodeChar depending on code page?
Post 16 Oct 2010, 20:53
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.