This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: wcwidth and terminals [Re: Mg3a - a version of Mg2a developed on Cygwin]


On 25 February 2011 11:05, Corinna Vinschen wrote:
> On Feb 25 09:05, Thomas Wolff wrote:
>> For cygwin, it might be useful (although not standard) for wcwidth
>> to consider whether it's running in a cygwin console or a terminal,
>> so e.g. wcwidth (0x8080) should return 2 in mintty but 1 in a cygwin
>> console.
>
> Hmm, I don't think that's the right thing to do. ÂHow's the OS version
> of wcwidht supposed to know what the wcwidth function is used for?
> After all, the application does *not* specify that it calls wcwidth
> to get the size of a character for a specifc purpose. ÂHow's the function
> to know that the character is supposed to be printed to the current tty?
> What if the application has open handles to more than one tty?

I agree. Also, I'd be surprised if character width in the console was
actually constant across different locales, fonts, and Windows
versions.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]