X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <20090512173153.GY21324@calimero.vinschen.de> References: <20090512165404 DOT GW21324 AT calimero DOT vinschen DOT de> <416096c60905120956n5521929bm69586f5e6325a994 AT mail DOT gmail DOT com> <20090512173153 DOT GY21324 AT calimero DOT vinschen DOT de> Date: Wed, 13 May 2009 20:04:06 +0100 Message-ID: <416096c60905131204r473ac1d3t4c811f7f0a4cb81f@mail.gmail.com> Subject: Re: [Fwd: [1.7] wcwidth failing configure tests] From: Andy Koppe To: newlib AT sourceware DOT org, cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 2009/5/12 Corinna Vinschen: >> Trouble is, there's the thorny issue of the "CJK Ambiguous Width" >> category of characters, which consists of things like Greek and >> Cyrillic letters as well as line drawing symbols. Those have a width >> of 1 in Western use, yet with CJK fonts they have a width of 2. That's >> why Markus Kuhn's code includes the mk_wcswidth_cjk() variant. > > We should use the standard variation alone, imho. I'm not sure that CJK users would be happy with that. See MinTTY issue 88 for my misguided attempts to dismiss this as a legacy issue: http://code.google.com/p/mintty/issues/detail?id=3D88 In comment 8 on that, "deenheart" mentioned that he was working on a fix for wcwidth(). I don't know what he had in mind, but I'd suspect something based on an environment variable setting. > And we need some workaround for UTF-16 systems like Cygwin. > Unfortunately, surrogate pairs only work well as part of a string, not > as standalone chars. =C2=A0So wcwidth would return -1 for each single cha= r, > but wcswidth could be tweaked to handle them gracefully. Looking at the ranges in wcwidth.c, it might be possible to decide the width of a surrogate pair based on the high surrogate only, and then treat the low surrogate as a combining character with length 0. Andy -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/