This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug locale/21862] New: Incorrect character widths for Tamil script


https://sourceware.org/bugzilla/show_bug.cgi?id=21862

            Bug ID: 21862
           Summary: Incorrect character widths for Tamil script
           Product: glibc
           Version: 2.25
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: locale
          Assignee: unassigned at sourceware dot org
          Reporter: eual.jp at gmail dot com
  Target Milestone: ---

Created attachment 10292
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10292&action=edit
A screenshot of program's output

wcswidth underestimates the number of columns required to display a string in
Tamil: it reports 35 columns, while in reality we need 39 (see the attached
screenshot). The code that produced it is:

    #define _XOPEN_SOURCE
    #include <wchar.h>
    #include <locale.h>

    int main()
    {
        const wchar_t * text = L"மாத சம்பளம் நன்கொடை: அதிபர் டிரம்ப் அசத்தல்";

        setlocale(LC_ALL, "en_US.utf8");

        wprintf(L"        |   .    |    .    |    .    |    .    |    .   
|\n");
        wprintf(L"String: %ls\n", text);
        wprintf(L"Its length is %zi characters.\n", wcslen(text));
        wprintf(L"It needs %i columns to be printed out.\n", wcswidth(text,
wcslen(text)));

        return 0;
    }

I followed the code up until the call to _NL_CURRENT (LC_CTYPE,
_NL_CTYPE_WIDTH), but I can't find the place where the table that _NL_CURRENT
returns is generated.

(This bug is the result of a bug filed against an application that I maintain:
https://github.com/akrennmair/newsbeuter/issues/584 )

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]