summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-06-22 12:49:01 -0600
committerKarl Williamson <public@khwilliamson.com>2013-07-07 13:29:44 -0600
commit28acfe03fc59abea4ef2451b134d560f411183ab (patch)
treee9ba297137a5aea6018e24c490d990c012860003 /locale.c
parent7187d38ecd872451f4332f094b3d173fe8d57255 (diff)
downloadperl-28acfe03fc59abea4ef2451b134d560f411183ab.tar.gz
PATCH: [perl #118197] Cope with non-ASCII decimal separators
This patch causes the radix string to be examined upon a new numeric locale being set. If the string isn't ASCII, and the new locale is UTF-8, it turns on the UTF-8 flag in the scalar that holds the radix. When a floating point number is formatted in Perl_sv_vcatpvfn_flags(), and the flag is on, the result's flag will be set on too.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/locale.c b/locale.c
index 1fd6fde075..5223a89216 100644
--- a/locale.c
+++ b/locale.c
@@ -94,6 +94,12 @@ Perl_set_numeric_radix(pTHX)
sv_setpv(PL_numeric_radix_sv, lc->decimal_point);
else
PL_numeric_radix_sv = newSVpv(lc->decimal_point, 0);
+ if (! is_ascii_string((U8 *) lc->decimal_point, 0)
+ && is_utf8_string((U8 *) lc->decimal_point, 0)
+ && is_cur_LC_category_utf8(LC_NUMERIC))
+ {
+ SvUTF8_on(PL_numeric_radix_sv);
+ }
}
}
else