summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-12-13 21:48:19 -0700
committerKarl Williamson <public@khwilliamson.com>2011-12-15 16:25:51 -0700
commit051a06d4bf2bf1ff5da602fa4088227becfa244f (patch)
tree307c39afe3e27ef127e6cea8b2e50eb006052976 /utf8.h
parent4b59338969ca96226e559bdd556f9f56e4fcbc17 (diff)
downloadperl-051a06d4bf2bf1ff5da602fa4088227becfa244f.tar.gz
utf8.c: Allow Changed behavior of utf8 under locale
This changes the 4 case changing functions to take extra parameters to specify if the utf8 string is to be processed under locale rules when the code points are < 256. The current functions are changed to macros that call the new versions so that current behavior is unchanged. An additional, static, function is created that makes sure that the 255/256 boundary is not crossed during the case change.
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/utf8.h b/utf8.h
index 6aa441239f..d57a3ef5a5 100644
--- a/utf8.h
+++ b/utf8.h
@@ -16,8 +16,16 @@
# define USE_UTF8_IN_NAMES (PL_hints & HINT_UTF8)
#endif
+/* For to_utf8_fold_flags, q.v. */
+#define FOLD_FLAGS_LOCALE 0x1
+#define FOLD_FLAGS_FULL 0x2
+
#define to_uni_fold(c, p, lenp) _to_uni_fold_flags(c, p, lenp, 1)
-#define to_utf8_fold(c, p, lenp) _to_utf8_fold_flags(c, p, lenp, 1)
+#define to_utf8_fold(c, p, lenp) _to_utf8_fold_flags(c, p, lenp, \
+ FOLD_FLAGS_FULL, NULL)
+#define to_utf8_lower(a,b,c) _to_utf8_lower_flags(a,b,c,0, NULL)
+#define to_utf8_upper(a,b,c) _to_utf8_upper_flags(a,b,c,0, NULL)
+#define to_utf8_title(a,b,c) _to_utf8_title_flags(a,b,c,0, NULL)
/* Source backward compatibility. */
#define uvuni_to_utf8(d, uv) uvuni_to_utf8_flags(d, uv, 0)