Mail Archives: cygwin/2009/06/15/10:36:00
2009/6/15 Corinna Vinschen <corinna-cygwin AT cygwin DOT com>:
>> Yes, but the guideline exists.
>> http://cygwin.com/ml/cygwin/2009-05/msg00444.html
>
> A single mail in a single mailing list of a single project. =A0That's rat=
her
> a suggestion than a guideline...
Sorry, my writing was bad. My quotation is a part of Unicode Standard
Annex #11 EAST ASIAN WIDTH.
Please see "When processing or displaying data" of "5 Recommendations"
at http://www.unicode.org/unicode/reports/tr11/ .
> If everybody agrees to this suggestion, here's the patch.
Is the name of modifier prefix "cjk-" good? It influences not CJK
characters but a part of symbols and European characters.
Please refer to Andy's opinion:
http://cygwin.com/ml/cygwin/2009-06/msg00240.html
It personally proposes "ambinarrow" because the switch of Vim is "ambiwidth=
".
And, I don't think that it is symmetrical. How about the following
patch? (I have not changed the name of modifier prefix)
--- libc/locale/locale.c.ORIG 2009-06-15 23:05:40.812500000 +0900
+++ libc/locale/locale.c 2009-06-15 22:56:35.546875000 +0900
@@ -398,7 +398,8 @@
int (*l_mbtowc) (struct _reent *, wchar_t *, const char *, size_t,
const char *, mbstate_t *);
#ifdef _MB_CAPABLE
- int cjknarrow =3D 0;
+#define CJK_DEFAULT -1
+ int cjk_lang =3D CJK_DEFAULT;
#endif
/* "POSIX" is translated to "C", as on Linux. */
@@ -453,11 +454,14 @@
if (c[0] =3D=3D '@')
{
/* Modifier */
- /* Only one modifier is recognized right now. "cjknarrow" is used
- to modify the behaviour of wcwidth() for East Asian languages.
- For details see the comment at the end of this function. */
+ /* Only one modifier is recognized right now. "cjknarrow" and
+ "cjkwide" are used to modify the behaviour of wcwidth() for
+ East Asian languages. For details see the comment at the
+ end of this function. */
if (!strcmp (c + 1, "cjknarrow"))
- cjknarrow =3D 1;
+ cjk_lang =3D 0;
+ else if (!strcmp (c + 1, "cjkwide"))
+ cjk_lang =3D 1;
}
#endif
}
@@ -627,10 +631,11 @@
The result is stored in lc_ctype_cjk_lang and tested in wcwidth()
to figure out the width to return (1 or 2) for the "CJK Ambiguous
Width" category of characters. */
- lc_ctype_cjk_lang =3D !cjknarrow
- && ((strncmp (locale, "ja", 2) =3D=3D 0
- || strncmp (locale, "ko", 2) =3D=3D 0
- || strncmp (locale, "zh", 2) =3D=3D 0));
+ lc_ctype_cjk_lang =3D cjk_lang !=3D CJK_DEFAULT
+ ? cjk_lang
+ : ((strncmp (locale, "ja", 2) =3D=3D 0
+ || strncmp (locale, "ko", 2) =3D=3D 0
+ || strncmp (locale, "zh", 2) =3D=3D 0));
#endif
}
else if (category =3D=3D LC_MESSAGES)
--=20
IWAMURO Motnori <http://vmi.jp/>
--
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/
- Raw text -