diff --git a/lib/gchart.rb b/lib/gchart.rb index 3f7f4d3..45d59d7 100644 --- a/lib/gchart.rb +++ b/lib/gchart.rb @@ -249,8 +249,10 @@ def datasets end def self.jstize(string) + # See http://github.com/mattetti/googlecharts/issues#issue/27 + URI.escape( string ) # See discussion: http://github.com/mattetti/googlecharts/commit/9b5cfb93aa51aae06611057668e631cd515ec4f3#comment_51347 - string.gsub(' ', '+').gsub(/\[|\{|\}|\\|\^|\[|\]|\`|\]/) {|c| "%#{c[0].to_s.upcase}"} + # string.gsub(' ', '+').gsub(/\[|\{|\}|\\|\^|\[|\]|\`|\]/) {|c| "%#{c[0].to_s.upcase}"} # string.gsub(' ', '+').gsub(/\[|\{|\}|\||\\|\^|\[|\]|\`|\]/) {|c| "%#{c[0].to_s.upcase}"} end # load all the custom aliases