https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247494

            Bug ID: 247494
           Summary: sort(1) order affected by LC_CTYPE
           Product: Base System
           Version: 12.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: b...@freebsd.org
          Reporter: k...@freebsd.org

My understanding is it is LC_COLLATE that affects how sort(1) compares
characters
and the C locale has the collation for binary comparison, so I set LC_COLLATE=C
when calling sort(1) for language independent sorting, but it seems LC_CTYPE
also
affects how sort(1) works.

% (echo 耳 ; echo 脳 ; echo 耳) | LC_CTYPE=ja_JP.UTF-8 LC_COLLATE=C LANG=C sort
耳
脳
耳

% (echo 耳 ; echo 脳 ; echo 耳) | LC_CTYPE=C LC_COLLATE=C LANG=C sort
耳
耳
脳


For reference, GNU sort works fine with any LC_CTYPE, and according to a NetBSD
user
the same goes for NetBSD sort.

% (echo 耳 ; echo 脳 ; echo 耳) | LC_CTYPE=ja_JP.UTF-8 LC_COLLATE=C LANG=C gsort
耳
耳
脳


Is this a bug or by design?

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to