Subject: bug#12055: 24.1.50; Characters "á" and "é" are not correctly displayed on a Windows terminal

From: Jason Rumney <[email-masked]>
Date: Sat, 28 Jul 2012 00:46:08 +0800

Eli Zaretskii <[email-masked]> writes:

>> Date: Fri, 27 Jul 2012 12:04:57 +0300
>> From: Eli Zaretskii <[email-masked]>
>> Cc: [email-masked], [email-masked]
>> 
>> > Date: Fri, 27 Jul 2012 10:35:53 +0200
>> > From: Dani Moncayo <[email-masked]>
>> > Cc: [email-masked], [email-masked]
>> > 
>> > > Please try that in the non-GUI session where you first set the
>> > > terminal coding-system to cp850.
>> > 
>> > Ok.  If I do:
>> > 1. emacs -nw -Q
>> > 2. C-x RET t cp850 RET
>> > 3. Visit the test file.
>> > 
>> > Then the file is corrrectly displayed.
>> 
>> Thanks.  If no one beats me to it, I will look into the input issue
>> when I have time.
>
> Well, I see some strange stuff in the input processing.

	  /* Get the codepage to interpret this key with.  */
          GetLocaleInfo (GetThreadLocale (),
			 LOCALE_IDEFAULTANSICODEPAGE, cp, 20);
	  cpId = atoi (cp);

is quite suspicious. It appears in two places - one is a fallback for
older versions of Windows that do not fully support Unicode, the other
is more interesting for this case, as it is in the dead key handling,
and from Juanma's description, a dead key is being used to input the
problem characters.

The above lines should probably be replaced with

   cpId = GetConsoleCP ();