diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-06-22 12:49:01 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-07-07 13:29:44 -0600 |
commit | 28acfe03fc59abea4ef2451b134d560f411183ab (patch) | |
tree | e9ba297137a5aea6018e24c490d990c012860003 /locale.c | |
parent | 7187d38ecd872451f4332f094b3d173fe8d57255 (diff) | |
download | perl-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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |