Contains Unicode codepoints, loading as needed from YAML files
Returns string with its UTF-8 characters transliterated to ASCII ones
You’re probably better off just using the added String#to_ascii
# File lib/stringex/unidecoder.rb, line 15 def decode(string) string.chars.map{|char| decoded(char)}.join end
Returns character for the given Unicode codepoint
# File lib/stringex/unidecoder.rb, line 20 def encode(codepoint) ["0x#{codepoint}".to_i(16)].pack("U") end
Returns Unicode codepoint for the given character
# File lib/stringex/unidecoder.rb, line 25 def get_codepoint(character) "%04x" % character.unpack("U")[0] end
Returns string indicating which file (and line) contains the transliteration value for the character
# File lib/stringex/unidecoder.rb, line 31 def in_yaml_file(character) unpacked = character.unpack("U")[0] "#{code_group(unpacked)}.yml (line #{grouped_point(unpacked) + 2})" end
Generated with the Darkfish Rdoc Generator 2.