Module: LoaderRuby::EncodingDetector
- Included in:
- Loaders::Html, Loaders::Text, Loaders::Web
- Defined in:
- lib/loader_ruby/encoding_detector.rb
Overview
Detects file encoding from BOM or content-type header and transcodes to UTF-8.
Constant Summary collapse
- BOM_MAP =
{ "\xEF\xBB\xBF".b => "UTF-8", "\xFF\xFE".b => "UTF-16LE", "\xFE\xFF".b => "UTF-16BE", "\xFF\xFE\x00\x00".b => "UTF-32LE", "\x00\x00\xFE\xFF".b => "UTF-32BE" }.freeze