method
find_encoding
v1_9_3_125 -
Show latest stable
-
0 notes -
Class: REXML::Encoding
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
find_encoding(name)
private
Hide source
# File lib/rexml/encoding.rb, line 45 def find_encoding(name) case name when /\Ashift-jis\z/ return "SHIFT_JIS" when /\ACP-(\d+)\z/ name = "CP#{$1}" when /\AUTF-8\z/ return name end begin ::Encoding::Converter.search_convpath(name, 'UTF-8') rescue ::Encoding::ConverterNotFoundError return nil end name end