bool TextEncoding::isUTF7Encoding() const { if (noExtendedTextEncodingNameUsed()) return false; return *this == UTF7Encoding(); }
bool TextEncoding::usesVisualOrdering() const { if (noExtendedTextEncodingNameUsed()) return false; static const char* const a = atomicCanonicalTextEncodingName("ISO-8859-8"); return m_name == a; }
UChar TextEncoding::backslashAsCurrencySymbol() const { if (noExtendedTextEncodingNameUsed()) return '\\'; // The text encodings below treat backslash as a currency symbol. // See http://blogs.msdn.com/michkap/archive/2005/09/17/469941.aspx for more information. static const char* const a = atomicCanonicalTextEncodingName("Shift_JIS_X0213-2000"); static const char* const b = atomicCanonicalTextEncodingName("EUC-JP"); return (m_name == a || m_name == b) ? 0x00A5 : '\\'; }
bool TextEncoding::isNonByteBasedEncoding() const { if (noExtendedTextEncodingNameUsed()) { return *this == UTF16LittleEndianEncoding() || *this == UTF16BigEndianEncoding(); } return *this == UTF16LittleEndianEncoding() || *this == UTF16BigEndianEncoding() || *this == UTF32BigEndianEncoding() || *this == UTF32LittleEndianEncoding(); }
const char* TextEncoding::domName() const { if (noExtendedTextEncodingNameUsed()) return m_name; // We treat EUC-KR as windows-949 (its superset), but need to expose // the name 'EUC-KR' because the name 'windows-949' is not recognized by // most Korean web servers even though they do use the encoding // 'windows-949' with the name 'EUC-KR'. // FIXME: This is not thread-safe. At the moment, this function is // only accessed in a single thread, but eventually has to be made // thread-safe along with usesVisualOrdering(). static const char* const a = atomicCanonicalTextEncodingName("windows-949"); if (m_name == a) return "EUC-KR"; return m_name; }
bool TextEncoding::isJapanese() const { if (noExtendedTextEncodingNameUsed()) return false; static HashSet<const char*> set; if (set.isEmpty()) { addEncodingName(set, "x-mac-japanese"); addEncodingName(set, "cp932"); addEncodingName(set, "JIS_X0201"); addEncodingName(set, "JIS_X0208-1983"); addEncodingName(set, "JIS_X0208-1990"); addEncodingName(set, "JIS_X0212-1990"); addEncodingName(set, "JIS_C6226-1978"); addEncodingName(set, "Shift_JIS_X0213-2000"); addEncodingName(set, "ISO-2022-JP"); addEncodingName(set, "ISO-2022-JP-2"); addEncodingName(set, "ISO-2022-JP-1"); addEncodingName(set, "ISO-2022-JP-3"); addEncodingName(set, "EUC-JP"); addEncodingName(set, "Shift_JIS"); } return m_name && set.contains(m_name); }