Skip to content

Commit 856ebf2

Browse files
committed
fix icu_numpunct constructor
1 parent ff22efc commit 856ebf2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/icu/numeric.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,12 @@ template<typename CharType>
360360
struct icu_numpunct : public numpunct<CharType> {
361361
typedef std::basic_string<CharType> string_type;
362362
public:
363-
icu_numpunct(icu::Locale const &loc)
363+
icu_numpunct(cdata const &d)
364364
{
365365
UErrorCode err = U_ZERO_ERROR;
366-
icu::NumberFormat *fmt = icu::NumberFormat::createInstance(loc, UNUM_DECIMAL, err);
366+
icu::NumberFormat *fmt = icu::NumberFormat::createInstance(d.locale, UNUM_DECIMAL, err);
367367
if (icu::DecimalFormat *dec = dynamic_cast<icu::DecimalFormat *>(fmt)) {
368-
boost::locale::impl_icu::icu_std_converter<CharType> cnv("UTF-8");
368+
boost::locale::impl_icu::icu_std_converter<CharType> cnv(d.encoding);
369369
const icu::DecimalFormatSymbols *syms = dec->getDecimalFormatSymbols();
370370
decimal_point_ = cnv.std(syms->getSymbol(icu::DecimalFormatSymbols::kDecimalSeparatorSymbol));
371371
thousands_sep_ = cnv.std(syms->getSymbol(icu::DecimalFormatSymbols::kGroupingSeparatorSymbol));
@@ -404,7 +404,7 @@ std::locale install_formatting_facets(std::locale const &in,cdata const &cd)
404404
if(!std::has_facet<icu_formatters_cache>(in)) {
405405
tmp=std::locale(tmp,new icu_formatters_cache(cd.locale));
406406
}
407-
tmp=std::locale(tmp, new icu_numpunct<CharType>(cd.locale));
407+
tmp=std::locale(tmp, new icu_numpunct<CharType>(cd));
408408
return tmp;
409409
}
410410

0 commit comments

Comments
 (0)