11 #include "settings/lib/ISettingCallback.h" 12 #include "utils/GlobalsHandling.h" 26 void OnSettingChanged(
const std::shared_ptr<const CSetting>& setting)
override;
29 static void resetSystemCharset();
30 static void reinitCharsetsFromSettings(
void);
43 static bool utf8ToUtf32(
const std::string& utf8StringSrc, std::u32string& utf32StringDst,
bool failOnBadChar =
true);
52 static std::u32string
utf8ToUtf32(
const std::string& utf8StringSrc,
bool failOnBadChar =
true);
66 static bool utf8ToUtf32Visual(
const std::string& utf8StringSrc, std::u32string& utf32StringDst,
bool bVisualBiDiFlip =
false,
bool forceLTRReadingOrder =
false,
bool failOnBadChar =
false);
76 static bool utf32ToUtf8(
const std::u32string& utf32StringSrc, std::string& utf8StringDst,
bool failOnBadChar =
false);
85 static std::string
utf32ToUtf8(
const std::u32string& utf32StringSrc,
bool failOnBadChar =
false);
95 static bool utf32ToW(
const std::u32string& utf32StringSrc, std::wstring& wStringDst,
bool failOnBadChar =
false);
105 std::u32string& visualStringDst,
106 bool forceLTRReadingOrder =
false,
107 bool failOnBadString =
false,
108 int* visualToLogicalMap =
nullptr);
118 static bool wToUtf32(
const std::wstring& wStringSrc, std::u32string& utf32StringDst,
bool failOnBadChar =
false);
120 static bool utf8ToW(
const std::string& utf8StringSrc, std::wstring& wStringDst,
121 bool bVisualBiDiFlip =
true,
bool forceLTRReadingOrder =
false,
122 bool failOnBadChar =
false);
124 static bool utf16LEtoW(
const std::u16string& utf16String, std::wstring& wString);
126 static bool subtitleCharsetToUtf8(
const std::string& stringSrc, std::string& utf8StringDst);
128 static bool utf8ToStringCharset(
const std::string& utf8StringSrc, std::string& stringDst);
130 static bool utf8ToStringCharset(std::string& stringSrcDst);
131 static bool utf8ToSystem(std::string& stringSrcDst,
bool failOnBadChar =
false);
132 static bool systemToUtf8(
const std::string& sysStringSrc, std::string& utf8StringDst,
bool failOnBadChar =
false);
134 static bool utf8To(
const std::string& strDestCharset,
const std::string& utf8StringSrc, std::string& stringDst);
135 static bool utf8To(
const std::string& strDestCharset,
const std::string& utf8StringSrc, std::u16string& utf16StringDst);
136 static bool utf8To(
const std::string& strDestCharset,
const std::string& utf8StringSrc, std::u32string& utf32StringDst);
138 static bool ToUtf8(
const std::string& strSourceCharset,
const std::string& stringSrc, std::string& utf8StringDst,
bool failOnBadChar =
false);
140 static bool wToUTF8(
const std::wstring& wStringSrc, std::string& utf8StringDst,
bool failOnBadChar =
false);
149 static bool utf16BEtoUTF8(
const std::u16string& utf16StringSrc, std::string& utf8StringDst);
158 static bool utf16BEtoUTF8(
const std::string& utf16StringSrc, std::string& utf8StringDst);
160 static bool utf16LEtoUTF8(
const std::u16string& utf16StringSrc, std::string& utf8StringDst);
161 static bool ucs2ToUTF8(
const std::u16string& ucs2StringSrc, std::string& utf8StringDst);
170 static bool MacintoshToUTF8(
const std::string& macStringSrc, std::string& utf8StringDst);
172 static bool utf8logicalToVisualBiDi(
const std::string& utf8StringSrc, std::string& utf8StringDst,
bool failOnBadString =
false);
181 static bool utf32ToStringCharset(
const std::u32string& utf32StringSrc, std::string& stringDst);
183 static std::vector<std::string> getCharsetLabels();
184 static std::string getCharsetLabelByName(
const std::string& charsetName);
185 static std::string getCharsetNameByLabel(
const std::string& charsetLabel);
187 static bool unknownToUTF8(std::string& stringSrcDst);
188 static bool unknownToUTF8(
const std::string& stringSrc, std::string& utf8StringDst,
bool failOnBadChar =
false);
190 static bool toW(
const std::string& stringSrc, std::wstring& wStringDst,
const std::string& enc);
191 static bool fromW(
const std::wstring& wStringSrc, std::string& stringDst,
const std::string& enc);
193 static void SettingOptionsCharsetsFiller(
const std::shared_ptr<const CSetting>& setting,
194 std::vector<StringSettingOption>& list,
195 std::string& current,
199 static void resetUserCharset(
void);
200 static void resetSubtitleCharset(
void);
202 static const int m_Utf8CharMinSize, m_Utf8CharMaxSize;
207 #define g_charsetConverter XBMC_GLOBAL_USE(CCharsetConverter) static bool wToUtf32(const std::wstring &wStringSrc, std::u32string &utf32StringDst, bool failOnBadChar=false)
Strictly convert wchar_t string (wstring) to UTF-32 string.
Definition: CharsetConverter.cpp:724
static bool utf32ToW(const std::u32string &utf32StringSrc, std::wstring &wStringDst, bool failOnBadChar=false)
Convert UTF-32 string to wchar_t string (wstring).
Definition: CharsetConverter.cpp:703
Definition: ISettingCallback.h:16
Setting base class containing all the properties which are common to all settings independent of the ...
Definition: Setting.h:46
static bool utf8IsRTLBidiDirection(const std::string &utf8String)
Check if a string has RTL direction.
Definition: CharsetConverter.cpp:894
static bool utf32logicalToVisualBiDi(const std::u32string &logicalStringSrc, std::u32string &visualStringDst, bool forceLTRReadingOrder=false, bool failOnBadString=false, int *visualToLogicalMap=nullptr)
Perform logical to visual flip.
Definition: CharsetConverter.cpp:713
Definition: SettingDefinitions.h:85
Definition: CharsetConverter.cpp:268
static bool utf16BEtoUTF8(const std::u16string &utf16StringSrc, std::string &utf8StringDst)
Convert UTF-16BE (u16string) string to UTF-8 string. No RTL visual-logical transformation is performe...
Definition: CharsetConverter.cpp:837
static bool utf8ToUtf32(const std::string &utf8StringSrc, std::u32string &utf32StringDst, bool failOnBadChar=true)
Convert UTF-8 string to UTF-32 string.
Definition: CharsetConverter.cpp:666
void OnSettingChanged(const std::shared_ptr< const CSetting > &setting) override
The value of the given setting has changed.
Definition: CharsetConverter.cpp:589
static bool utf32ToUtf8(const std::u32string &utf32StringSrc, std::string &utf8StringDst, bool failOnBadChar=false)
Convert UTF-32 string to UTF-8 string.
Definition: CharsetConverter.cpp:691
static bool utf8ToUtf32Visual(const std::string &utf8StringSrc, std::u32string &utf32StringDst, bool bVisualBiDiFlip=false, bool forceLTRReadingOrder=false, bool failOnBadChar=false)
Convert UTF-8 string to UTF-32 string.
Definition: CharsetConverter.cpp:678
Definition: CharsetConverter.h:21
static bool MacintoshToUTF8(const std::string &macStringSrc, std::string &utf8StringDst)
Convert Macintosh (string) string to UTF-8 string. No RTL visual-logical transformation is performed...
Definition: CharsetConverter.cpp:879