|
5 | 5 | #ifndef SR_ENGINE_CONVERT_H |
6 | 6 | #define SR_ENGINE_CONVERT_H |
7 | 7 |
|
8 | | -#include <Utils/Localization/Icu.h> |
9 | | - |
10 | | -namespace SR_UTILS_NS::Localization { |
11 | | - //std::string ConvertBetween( |
12 | | - // const char *begin, |
13 | | - // const char *end, |
14 | | - // const std::string& to_charset, |
15 | | - // const std::string& from_charset, |
16 | | - // EncMethodType how = EncMethodType::Default |
17 | | - // ) { |
18 | | - // auto&& from = ICU::IcuStdConverter<char>(from_charset, how); |
19 | | - // auto&& to = ICU::IcuStdConverter<char>(to_charset, how); |
20 | | - // return to.Std(from.Icu(begin, end)); |
21 | | - // } |
22 | | - |
23 | | - template<typename CharType> std::basic_string<CharType> ConvertTo(const char *begin, const char *end, const char *charset, EncMethodType how = EncMethodType::Default) { |
24 | | - #ifdef SR_ICU |
25 | | - auto&& from = ICU::IcuStdConverter<char>(charset, how); |
26 | | - auto&& to = ICU::IcuStdConverter<CharType>("UTF-8", how); |
27 | | - return to.Std(from.IcuChecked(begin, end)); |
28 | | - #else |
29 | | - return std::basic_string<CharType>(); |
30 | | - #endif |
31 | | - } |
32 | | - |
33 | | - template<typename CharType> std::string ConvertFrom(const CharType *begin, const CharType *end, const char *charset, EncMethodType how = EncMethodType::Default) { |
34 | | - #ifdef SR_ICU |
35 | | - auto&& from = ICU::IcuStdConverter<CharType>("UTF-8", how); |
36 | | - auto&& to = ICU::IcuStdConverter<char>(charset, how); |
37 | | - return to.Std(from.IcuChecked(begin, end)); |
38 | | - #else |
39 | | - return std::string(); |
40 | | - #endif |
41 | | - } |
42 | | -} |
| 8 | +//#include <Utils/Localization/Icu.h> |
| 9 | +// |
| 10 | +//namespace SR_UTILS_NS::Localization { |
| 11 | +// //std::string ConvertBetween( |
| 12 | +// // const char *begin, |
| 13 | +// // const char *end, |
| 14 | +// // const std::string& to_charset, |
| 15 | +// // const std::string& from_charset, |
| 16 | +// // EncMethodType how = EncMethodType::Default |
| 17 | +// // ) { |
| 18 | +// // auto&& from = ICU::IcuStdConverter<char>(from_charset, how); |
| 19 | +// // auto&& to = ICU::IcuStdConverter<char>(to_charset, how); |
| 20 | +// // return to.Std(from.Icu(begin, end)); |
| 21 | +// // } |
| 22 | +// |
| 23 | +// template<typename CharType> std::basic_string<CharType> ConvertTo(const char *begin, const char *end, const char *charset, EncMethodType how = EncMethodType::Default) { |
| 24 | +// #ifdef SR_ICU |
| 25 | +// auto&& from = ICU::IcuStdConverter<char>(charset, how); |
| 26 | +// auto&& to = ICU::IcuStdConverter<CharType>("UTF-8", how); |
| 27 | +// return to.Std(from.IcuChecked(begin, end)); |
| 28 | +// #else |
| 29 | +// return std::basic_string<CharType>(); |
| 30 | +// #endif |
| 31 | +// } |
| 32 | +// |
| 33 | +// template<typename CharType> std::string ConvertFrom(const CharType *begin, const CharType *end, const char *charset, EncMethodType how = EncMethodType::Default) { |
| 34 | +// #ifdef SR_ICU |
| 35 | +// auto&& from = ICU::IcuStdConverter<CharType>("UTF-8", how); |
| 36 | +// auto&& to = ICU::IcuStdConverter<char>(charset, how); |
| 37 | +// return to.Std(from.IcuChecked(begin, end)); |
| 38 | +// #else |
| 39 | +// return std::string(); |
| 40 | +// #endif |
| 41 | +// } |
| 42 | +//} |
43 | 43 |
|
44 | 44 | #endif //SR_ENGINE_CONVERT_H |
0 commit comments