Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Unicode support for Windows console
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bram Moolenaar  
View profile  
 More options Nov 6 2007, 4:19 pm
From: Bram Moolenaar <B...@moolenaar.net>
Date: Tue, 06 Nov 2007 22:19:39 +0100
Local: Tues, Nov 6 2007 4:19 pm
Subject: Re: Unicode support for Windows console

Andrew Sunbar wrote:
> Long time Vim user, first time hacker.

> I've recently noticed that although the Windows console has supported
> Unicode since Windows 2000,
> Vim for the Windows console doesn't yet support Unicode.

> There are two ways to write Unicode to the Windows console: Native
> Windows UCS-2/UTF-16
> accessed via Windows's ...W APIs and UTF-8 accessed via Windows's ...A
> APIs after setting the
> console's code page to UTF-8. I'm assuming the latter method will be
> easier for Vim.

> To see how Vim currently behaves in UTF-8 here are the steps:
> >From the Start menu choose "Run"
> Enter "cmd /u" (this makes the console filehandles pipes etc work with
> Unicode)
> Type into the console "chcp 65001" (this sets the code page to UTF-8)
> Change the terminal font to a Unicode font: Right click title bar,
> Properties, Font, Lucida Console.
> Now run Vim.

> Even at startup the display is corrupt. My first guess is a
> discrepancy between number of bytes and number of characters in
> displayed strings. Note that :set termenc=utf8 and :set enc=utf8 have
> no effect.
> Note also that attributes (colours) and input seem to work fine.

> I'm just feeling my way around the Vim code so far but os_win32.c /
> write_chars() has caught my eye.
> Perhaps somebody on this list can direct me where else to look in the
> code.

As far as I know nearly nobody uses cp65001.  Vim doesn't support it.
I don't know if it would work when Vim would support is.  The MS-Windows
console is known to be flaky.

Input through Unicode (UTF-16) should work, but I don't know of people
actually using it.  Most non-Asian character sets are 8-bit.  Asians use
DBCS encodings.  So when would UTF-16 be used?

--
From "know your smileys":
 :q     vi user saying, "How do I get out of this damn emacs editor?"

 /// Bram Moolenaar -- B...@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.