apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 55832] New: [PATCH] apr_strnatcmp doesn't work correctly with multibyte characters
Date Sun, 01 Dec 2013 15:39:57 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=55832

            Bug ID: 55832
           Summary: [PATCH] apr_strnatcmp doesn't work correctly with
                    multibyte characters
           Product: APR
           Version: HEAD
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
          Assignee: bugs@apr.apache.org
          Reporter: apache@mecal.tk

Created attachment 31085
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31085&action=edit
A patch and a test for this issue

I attached a patch and a simple test for this issue.

apr_strnatcmp() should handle characters as "unsigned char *" (this is a strcmp
like behavior). However, apr_strnatcmp() handles characters as "char *" and it
causes inappropriate behavior. This is a example.

// "\xE3\x81\x82" == "あ" is a basic Japanese character in UTF-8
strcmp("a", "\xE3\x81\x82") => -1
apr_strnatcmp("a", "\xE3\x81\x82") => 1

It makes a sort result strainge.
Can anyone merge this patch?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message