summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-10-16 21:44:23 -0600
committerKarl Williamson <public@khwilliamson.com>2013-10-16 22:17:09 -0600
commit2430372414b6a23811d2683eed43009456f4f8ea (patch)
treef89748049b00cc82253e7c2993c1e9e45fb9a638 /utf8.c
parentcb4e82463ea6b3435de7bb0b1973c230d010b6c3 (diff)
downloadperl-2430372414b6a23811d2683eed43009456f4f8ea.tar.gz
Change mktables output for some tables to use hex
This makes all the tables in the lib/unicore/To directory that map from code point to code point be formatted so that the mapped-to code point is expressed as hexadecimal. This allows for uniform treatment of these tables in utf8.c, and removes the final use of strtol() in the (non-CPAN) core. strtol() should be avoided because it is subject to locale rules, and some older libc implementations have been buggy. It was used because Perl doesn't have an efficient way of parsing a decimal number and advancing the parse pointer to beyond it; we do have such a method for hex numbers. The input to mktables published by Unicode is also in hex, so this now conforms to that convention. This also will facilitate the new work currently being done to read in the tables that find the closing bracket given an opening one.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/utf8.c b/utf8.c
index 52c3143cda..b798bd0182 100644
--- a/utf8.c
+++ b/utf8.c
@@ -3424,20 +3424,10 @@ S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val,
*max = *min;
/* Non-binary tables have a third entry: what the first element of the
- * range maps to */
+ * range maps to. The map for those currently read here is in hex */
if (wants_value) {
if (isBLANK(*l)) {
++l;
-
- /* The ToLc, etc table mappings are not in hex, and must be
- * corrected by adding the code point to them */
- if (typeto) {
- char *after_strtol = (char *) lend;
- *val = Strtol((char *)l, &after_strtol, 10);
- l = (U8 *) after_strtol;
- }
- else { /* Other tables are in hex, and are the correct result
- without tweaking */
flags = PERL_SCAN_SILENT_ILLDIGIT
| PERL_SCAN_DISALLOW_PREFIX
| PERL_SCAN_SILENT_NON_PORTABLE;
@@ -3447,7 +3437,6 @@ S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val,
l += numlen;
else
*val = 0;
- }
}
else {
*val = 0;