<div><br></div><div class="nh_extra"><p>Dnia 26 kwietnia 2025 09:03 Eli Zaretskii <eliz@gnu.org> napisaƂ(a):<br></p><blockquote class="nh_quote" style="border-left: 2px solid #999; padding-left: 8px; margin: 0;"><div id="gwp667282da"><blockquote><div>Date: Fri, 25 Apr 2025 23:21:05 +0200<br></div><div>From: "piotrunio-2004@wp.pl via Unicode" <unicode@corp.unicode.org><br></div><div><br></div><div>In non-Unix-like terminals, the width is always linearly proportional to the amount of bytes that the text takes<br></div><div>in memory, because that is how a random access array works. Each character cell takes a constant amount<br></div><div>of bytes, for example in VGA-compatible text mode there are 16 bits per character cell (8 bits for attributes<br></div><div>and 8 bits for character code), and in Win32 console there are 32 bits per character cell (16 bits for<br></div><div>attributes and 16 bits for character code). Whether a character is fullwidth may be determined by the text<br></div><div>encoding (some legacy encodings such as Shift JIS will store fullwidth characters in the bytes of two<br></div><div>consecutive character cells) or by attributes.<br></div></blockquote><div><br></div><div>I think you have very outdated mental model of how the Windows console<br></div><div>works and how it represents and encodes characters.  In particular,<br></div><div>the width of a character is NOT determined by the length of its byte<br></div><div>sequence, but by the font glyphs used to display those characters.<br></div></div></blockquote></div><div><br></div><div>The CHAR_INFO structure is defined as a 32-bit structure with 16 bits for attributes and 16 bits for character code. The Win32 API allows for directly reading and writing arrays of that structure by using ReadConsoleOutput<span> and Write</span>ConsoleOutput functions. This means that there is absolutely no way that a native Win32 console could possibly store its characters in a variable amount of bytes; in particular, the structure cannot store emoji +VC15, +VC16 sequences because it was never intended for that purpose.<br></div><div><br></div>