bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] patch: Improve the rolling file name length for downloadi


From: Eli Zaretskii
Subject: Re: [Bug-wget] patch: Improve the rolling file name length for downloading progress image when without NLS
Date: Fri, 17 Feb 2017 12:05:21 +0200

> From: Tim Ruehsen <address@hidden>
> Date: Fri, 17 Feb 2017 09:48:23 +0100
> Cc: "Andries E. Brouwer" <address@hidden>, YX Hao <address@hidden>
> Calculating the number of displayed columns from the number of bytes of a 
> string is non-trivial. It is trivial only for charsets/locales where each 
> byte 
> (or codepoint) will take exactly one column on the display.
> 
> With unicode you have to *at least* compose the string first (NFC I guess), 
> and 
> then count the codepoints. But I am not sure about exceptions.
> 
> @Andries Do you know an algorithm how to calculate the columns from a given 
> string + encoding ?

I'm not Andries, but AFAIK there's a file in the Unicode Character
Database (UCD) called EastAsianWidth.txt which provides the width
information.

There's also this (which is a derivative of the UCD data):

  https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c



reply via email to

[Prev in Thread] Current Thread [Next in Thread]