Skip to content

Instantly share code, notes, and snippets.

@myokoym
Created February 17, 2014 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myokoym/9044226 to your computer and use it in GitHub Desktop.
Save myokoym/9044226 to your computer and use it in GitHub Desktop.
Ruby標準添付のURIモジュールをマルチバイトのファイル名に対応させたくてがんばった結果
module URI
class Generic
alias :__path__ :path
def path
URI.decode_www_form_component(__path__, Encoding.find("locale"))
end
end
def self.parse(uri)
uri = URI.encode_www_form_component(uri)
DEFAULT_PARSER.parse(uri)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment