]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: is_unicode_equiv: implement Unicode equivalence class check
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 15 Feb 2023 21:00:39 +0000 (22:00 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 15 Feb 2023 21:00:39 +0000 (22:00 +0100)
commitb5f9b0241a36b8e0197405fc5ab23cbf0ba43e03
tree3bf9b31b20e3cfa3f1be8b9087e253aa1a60e9f9
parentbe67844f5da8cb6fb4c39cfdb3460e6955660b8e
Cygwin: is_unicode_equiv: implement Unicode equivalence class check

is_unicode_equiv compares two UTF-32 values and returns 1 if
both are member of the same Unicode equivalence class, 0 otherwise.

Note that this function only works with precomposed characters
per Unicode normalization form C.  It doesn't handle decomposed
characters, just like its counterpart in glibc.  I.e., equivalence
class comparison using decomposed chars won't work.  Example:

  fnmatch("[=n=]", "ñ") == 0
  fnmatch("[=ñ=]", "n") == 0

but

  fnmatch("[=n=]", "n\x0303") == 1
  fnmatch("[=n\x0303=]", "n") == 1
  fnmatch("[=n\x0303=]", "n\x0303") == 1

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/local_includes/collate.h
winsup/cygwin/nlsfuncs.cc
This page took 0.027948 seconds and 5 git commands to generate.