After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 535022 - ambiguous width in utf8 locale
ambiguous width in utf8 locale
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.16.x
Other All
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-05-27 04:16 UTC by Bendany Qian
Modified: 2008-05-28 01:49 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Bendany Qian 2008-05-27 04:16:23 UTC
Please describe the problem:
I am using en_US.UTF-8 locale, and set VTE_CJK_WIDTH=1,
and I still get half width of ambiguous character.

from the source, I see I have to set my locale to ja/ko/vi/zh in order 
to make ambiguous width into 2. when I using en_US.UTF-8, I cannot make
it.

I don't think we need to guess since I am setting the env VTE_CJK_WIDTH=1
it is useless. otherwise we have to make a new env such as VTE_AMBIGUOUS_WIDTH=1
for user to force it as 2.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Behdad Esfahbod 2008-05-27 18:56:27 UTC
Ugh.  I wish we had made it return VTE_CJK_WIDTH directly and if not set, auto detect...  But using 1 for autodetect, we can't do that anymore.

Committed patch to make VTE_CJK_WIDTH=wide and VTE_CJK_WIDTH=narrow give you full control.  Any other value means "auto" based on locale.

Please test svn trunk.

2008-05-27  Behdad Esfahbod  <behdad@gnome.org>

        Bug 535022 – ambiguous width in utf8 locale

        * src/iso2022.c (_vte_iso2022_ambiguous_width): Recognize
        env var settings VTE_CJK_WIDTH=narrow and VTE_CJK_WIDTH=wide.
        Any other value means "auto" based on locale, as it was doing
        previously.

Comment 2 Bendany Qian 2008-05-28 00:34:57 UTC
I just check the source code, I think you miss a "return" before _vte_iso2022_ambiguous_width_guess(). ;-)

	/*
	 * Decide the ambiguous width according to the default region if 
	 * current locale is UTF-8.
	 */
	if (strcmp (codeset, "utf8") == 0 && g_getenv("VTE_CJK_WIDTH") != NULL) {
	  const char *env = g_getenv ("VTE_CJK_WIDTH");
	  if (g_ascii_strcasecmp (env, "narrow"))
	    return 1;
	  if (g_ascii_strcasecmp (env, "wide"))
	    return 2;
	  else
	    _vte_iso2022_ambiguous_width_guess ();
	}
Comment 3 Behdad Esfahbod 2008-05-28 00:38:31 UTC
So yeah...  Fixed.
Comment 4 Bendany Qian 2008-05-28 01:49:13 UTC
I have tested it. But got a strange result.

when I export VTE_CJK_WIDTH=narrow, I got the correct result.
ambiguous character has wide width. but when I set VTE_CJK_WIDTH=wide,
I got narrow result. I have double check the source.

There is no others using this enviroment. so I have no idea what is going on.