Created
February 17, 2014 03:28
-
-
Save myokoym/9044226 to your computer and use it in GitHub Desktop.
Ruby標準添付のURIモジュールをマルチバイトのファイル名に対応させたくてがんばった結果
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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