https://bz.apache.org/bugzilla/show_bug.cgi?id=70101

            Bug ID: 70101
           Summary: East Asian UTF-8 is three bytes long, but two columns
                    wide
           Product: Apache httpd-2
           Version: 2.4.52
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: mod_autoindex
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

In .htaccess, using
   IndexOptions Charset=UTF-8 NameWidth=*
reveals one problem. Apache 2.4 is not correctly counting spaces needed when
encountering UTF-8 characters:

Index of /B
      Name                                          Last modified      Size 
Description
      Parent Directory                                                   -
      積丹尼-路號門牌弧形網-(全文).docx 2026-05-27 07:14  1.5M
      youshi.docx                                   2026-05-05 10:05  1.5M
      YouTube_playlists.html                        2025-11-05 02:31   89K
      dan02.aqx                                     2025-06-27 19:18  3.8K

We see Apache has overcompensated. I bet it sees the UTF-8 as just three
bytes, when that is not what needs to be counted. Apache needs to use e.g.,

https://pandoc.org/lua-filters.html : real_length (str): Returns the
real length of a string in a monospace font: 0 for a combining
character, 1 for a regular character, 2 for an East Asian wide
character.

Else the columns get out of line.

Unix ls(1) avoids this problem by always printing the filename last.

See also https://httpd.apache.org/docs/current/mod/mod_autoindex.html

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to