LoginSignup
3
3

More than 5 years have passed since last update.

URI.escape() でescapeしたい文字を追加

Last updated at Posted at 2012-11-22
ruby
> URI.escape("O'Reilly Media")
 => "O'Reilly%20Media" 
> URI.escape("O'Reilly Media", Regexp.union(URI::UNSAFE, /['()]/))
 => "O%27Reilly%20Media"

Dropbox API のパスで ' などをエスケープする必要があった。
https://www.dropbox.com/developers/reference/api#metadata
もっといい方法ありそうだけど...

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3