Help us understand the problem. What is going on with this article?

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

More than 5 years have passed since last update.
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
もっといい方法ありそうだけど...

hiroshi3110
バッドノウハウの杜
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away