Comments (4)
Hello kinumi,
I believe this is an encoding bug. Can you try the commit 2133762 I just pushed and tell me if it works ?
Thanks,
Mael
from flickraw.
Thanks,
I tried it, then...
ruby1.9.3 -> ok
ruby1.8.7 -> ng (and I want to use 1.8.7!)
Test Code:
("現像" is "\xE7\x8F\xBE\xE5\x83\x8F" in utf8)
#!ruby -Ku
require "rubygems"
require "uri"
require "./flickraw/lib/flickraw"
str = "現像"
puts "#{str} should be escaped to [#{URI.escape(str)}]"
puts "#{str} is escaped to [#{FlickRaw::OAuthClient.escape(str)}]"
Result:
$ rvm use 1.9.3
$ ruby -I ./flickraw/lib/ flickr.rb
現像 should be escaped to [%E7%8F%BE%E5%83%8F]
現像 is escaped to [%E7%8F%BE%E5%83%8F]
$ rvm use 1.8.7
$ ruby -I ./flickraw/lib/ flickr.rb
現像 should be escaped to [%E7%8F%BE%E5%83%8F]
現像 is escaped to [%E7%E5]
from flickraw.
I modified oauth.rb. It seems to work well.
Before:
def escape(s)
encode_value(s).gsub(/[^a-zA-Z0-9\-\.\_\~]/) {
sprintf("%%%02X", $&.unpack("C")[0])
}
end
After:
def escape(s)
encode_value(s).gsub(/[^a-zA-Z0-9\-\.\_\~]/) {
$&.unpack("C*").map{|i| sprintf("%%%02X", i) }.join
}
end
from flickraw.
I have commited it on b33601c.
Thank you for the bug report and the patch !
from flickraw.
Related Issues (20)
- [suggestion] Convert account credentials to constructor parameters HOT 2
- [suggestion] Merge FlickRaw::Flickr into FlickRaw HOT 2
- Thanks for this library! HOT 2
- Release new version to RubyGems HOT 6
- FlickRaw::FlickrAppNotConfigured (No API key defined!) HOT 1
- Upload broken?
- Cannot create new Flickr object (ArgumentError) HOT 2
- Neither authentication method work. HOT 1
- Bug in url_h, url_k HOT 1
- undefined method `keys' for "year":String (NoMethodError) HOT 2
- Error "::OAuthClient::FailedResponse" HOT 2
- Flickr Video: Filetype was not recognised HOT 4
- SSL exception HOT 15
- FlickRaw::FlickrAppNotConfigured Exception is thrown when shared secret is not set HOT 1
- to_hash result for photo cannot be saved in mongoid HOT 1
- Testing Flickraw with VCR gives erratic results HOT 2
- Can't stub request to Flickr API then I try test my controller. HOT 2
- Can't set FlickRaw.ca_file
- flickr.photos.getRecent NoMethodError HOT 1
- Use of deprecated Fixnum HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flickraw.