Module: XSD::Charset

Defined in:
lib/xsd/charset.rb

Defined Under Namespace

Classes: CharsetConversionError, CharsetError, UnknownCharsetError, XSDError

Constant Summary collapse

EncodingConvertMap =

Maps

{}
CharsetMap =
{
  'NONE' => 'us-ascii',
  'EUC' => 'euc-jp',
  'SJIS' => 'shift_jis',
  'UTF8' => 'utf-8',
  'X_ISO_8859_1' => 'iso-8859-1',
  'X_UNKNOWN' => nil,
}
CharsetStrCache =
{}
NOENCODING_OPT =

Regexp::NOENCODING doesn't exist pre-1.9 (part of Ruby's M17N overhaul); these regexes match raw byte patterns regardless of string encoding, so on 1.8.7 -- which has no per-string encoding concept at all -- byte matching is just the default behavior and 0 (no special options) is the equivalent.

defined?(Regexp::NOENCODING) ? Regexp::NOENCODING : 0
USASCIIRegexp =

XML 1.0 restricted.

Regexp.new("\\A#{us_ascii}*\\z", NOENCODING_OPT)
EUCRegexp =
Regexp.new("\\A#{character_euc}*\\z", NOENCODING_OPT)
SJISRegexp =
Regexp.new("\\A#{character_sjis}*\\z", NOENCODING_OPT)
UTF8Regexp =
Regexp.new("\\A#{character_utf8}*\\z", NOENCODING_OPT)