# File lib/stringex/unidecoder.rb, line 16 16: def decode(string) 17: string.gsub(/[^\x00-\x7f]/u) do |codepoint| 18: if localized = local_codepoint(codepoint) 19: localized 20: else 21: begin 22: unpacked = codepoint.unpack("U")[0] 23: CODEPOINTS[code_group(unpacked)][grouped_point(unpacked)] 24: rescue 25: # Hopefully this won't come up much 26: # TODO: Make this note something to the user that is reportable to me perhaps 27: "?" 28: end 29: end 30: end 31: end