summaryrefslogtreecommitdiff
path: root/embed.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-01-28 19:28:40 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-01-28 19:28:40 +0000
commitf9a6324217cffea75ff769ddd313748c0613a128 (patch)
tree9fb5b4ade5877ba969d093cfe37ec605de62d8dc /embed.h
parent9ee2bb1a7c54b1866ff07ab9c157254810ee5205 (diff)
downloadperl-f9a6324217cffea75ff769ddd313748c0613a128.tar.gz
Patch from Inaba Hiroto:
- canonical UTF-8 hash keys: if a key string for a hash is UTF8-on, try downgrade the string and use it if unicode::distinct is not in effect. For the task, I added a function bytes_from_utf8() to utf8.c. It might resemble utf8_to_bytes() but it is not convenient to the task. Made a test for it and added to t/op/each.t - Changed do_print in doio.c to apply sv_utf8_(downgrade|upgrade) to the mortal copy of the argument SV. And changed t/io/utf8.t test 18 which expects print() to upgrade its argument. - re-implement sv_eq with bytes_from_utf8() - some bug fixes - tr/// does not handle UTF8 range (\x{}-\x{}) - \ before raw UTF8 character produced "Malformed UTF-8 character" warning. - "\x{100}\N{CENT SIGN}" is Malformed. Added tests for these 3. - and one silly bug (by me) with qu operator. p4raw-id: //depot/perl@8583
Diffstat (limited to 'embed.h')
-rw-r--r--embed.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/embed.h b/embed.h
index f2a05c7423..fe0b6b3198 100644
--- a/embed.h
+++ b/embed.h
@@ -737,6 +737,7 @@
#define utf8_distance Perl_utf8_distance
#define utf8_hop Perl_utf8_hop
#define utf8_to_bytes Perl_utf8_to_bytes
+#define bytes_from_utf8 Perl_bytes_from_utf8
#define bytes_to_utf8 Perl_bytes_to_utf8
#define utf8_to_uv_simple Perl_utf8_to_uv_simple
#define utf8_to_uv Perl_utf8_to_uv
@@ -2214,6 +2215,7 @@
#define utf8_distance(a,b) Perl_utf8_distance(aTHX_ a,b)
#define utf8_hop(a,b) Perl_utf8_hop(aTHX_ a,b)
#define utf8_to_bytes(a,b) Perl_utf8_to_bytes(aTHX_ a,b)
+#define bytes_from_utf8(a,b,c) Perl_bytes_from_utf8(aTHX_ a,b,c)
#define bytes_to_utf8(a,b) Perl_bytes_to_utf8(aTHX_ a,b)
#define utf8_to_uv_simple(a,b) Perl_utf8_to_uv_simple(aTHX_ a,b)
#define utf8_to_uv(a,b,c,d) Perl_utf8_to_uv(aTHX_ a,b,c,d)
@@ -4342,6 +4344,8 @@
#define utf8_hop Perl_utf8_hop
#define Perl_utf8_to_bytes CPerlObj::Perl_utf8_to_bytes
#define utf8_to_bytes Perl_utf8_to_bytes
+#define Perl_bytes_from_utf8 CPerlObj::Perl_bytes_from_utf8
+#define bytes_from_utf8 Perl_bytes_from_utf8
#define Perl_bytes_to_utf8 CPerlObj::Perl_bytes_to_utf8
#define bytes_to_utf8 Perl_bytes_to_utf8
#define Perl_utf8_to_uv_simple CPerlObj::Perl_utf8_to_uv_simple