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

Bug#1029069: marked as done (libc6: wcswidth doesn't report correct width for :)



Your message dated Tue, 17 Jan 2023 11:55:07 +0100
with message-id <20230117105507.anoh32uvvdmnrwma@begin>
and subject line Re: Bug#1029069: libc6: wcswidth doesn't report correct width for :
has caused the Debian Bug report #1029069,
regarding libc6: wcswidth doesn't report correct width for :
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1029069: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1029069
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libc6
Version: 2.36-6
Severity: minor

I've been trying to work out why the Chinese translation for free
doesn't want to line up the columns like everyone else, report is
at [1]

For some reason, it thinks the strange colon used in the translation is
one character wide, but its actually two. This means the column is
mis-aligned.

A small test program:
------
#define _XOPEN_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>

void printme(char *str)
{
    int len, width;
    wchar_t wstr[BUFSIZ];

    len = mbstowcs(wstr, str, BUFSIZ);
    width = wcswidth(wstr, 99);
    printf("len=%d width=%d\n",
            len, width, str);
    printf("%s%.s%s\n", str, 6 - width, "blah");
}

int main()
{
    printme(":");
    printme(":");

}
------
$~/width
len=1 width=1
:blah
len=-1 width=1
:blah

We can see that the second colon is 2 wide, the "b" in blah lines up
with the "n" in len but wcswidth thinks it is 2.  I have no idea why
this is so and even where this information comes from.

It's not the end-of-the world sort of bug, but it is a very stange one.

 - Craig

1: https://gitlab.com/procps-ng/procps/-/issues/213


-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.0.0-6-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE=en_AU:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libc6 depends on:
ii  libgcc-s1  12.2.0-10

Versions of packages libc6 recommends:
ii  libidn2-0  2.3.3-1+b1

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.80
pn  glibc-doc              <none>
ii  libc-l10n              2.36-6
pn  libnss-nis             <none>
pn  libnss-nisplus         <none>
ii  locales                2.36-6

-- debconf information excluded

--- End Message ---
--- Begin Message ---
Hello,

Craig Small, le mar. 17 janv. 2023 21:38:27 +1100, a ecrit:
> int main()
> {
>     printme(":");

This is missing a

setlocale(LC_ALL,"");

call. Otherwise libc remains in the C locale.

Samuel

--- End Message ---

Reply to: