diff options
Diffstat (limited to 'fxbarcode/BC_UtilCodingConvert.cpp')
-rw-r--r-- | fxbarcode/BC_UtilCodingConvert.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fxbarcode/BC_UtilCodingConvert.cpp b/fxbarcode/BC_UtilCodingConvert.cpp index 77c52f2074..96aeaddb7c 100644 --- a/fxbarcode/BC_UtilCodingConvert.cpp +++ b/fxbarcode/BC_UtilCodingConvert.cpp @@ -12,7 +12,7 @@ CBC_UtilCodingConvert::~CBC_UtilCodingConvert() {} void CBC_UtilCodingConvert::UnicodeToLocale(const WideString& src, ByteString& dst) { - dst = ByteString::FromUnicode(src); + dst = src.ToDefANSI(); } void CBC_UtilCodingConvert::LocaleToUtf8(const ByteString& src, @@ -34,15 +34,13 @@ void CBC_UtilCodingConvert::Utf8ToLocale(const std::vector<uint8_t>& src, for (uint8_t value : src) utf8 += value; - WideString unicode = WideString::FromUTF8(utf8.AsStringView()); - dst = ByteString::FromUnicode(unicode); + dst = WideString::FromUTF8(utf8.AsStringView()).ToDefANSI(); } void CBC_UtilCodingConvert::Utf8ToLocale(const uint8_t* src, int32_t count, ByteString& dst) { - WideString unicode = WideString::FromUTF8(ByteStringView(src, count)); - dst = ByteString::FromUnicode(unicode); + dst = WideString::FromUTF8(ByteStringView(src, count)).ToDefANSI(); } void CBC_UtilCodingConvert::UnicodeToUTF8(const WideString& src, |