chendo / lifx-http

A HTTP API for controlling LIFX devices.
MIT License
91 stars 13 forks source link

Error with umlauts #8

Closed einfallstoll closed 4 years ago

einfallstoll commented 10 years ago

lifx-http will throw an error if a bulb is named with an umlaut, e.g. "Büro" (Bureau).

macbook:~ fabiopoloni$ lifx-http
lifx-http can be reached at http://lifx-http.local:56780/
[2014-05-02 19:42:12] INFO  WEBrick 1.3.1
[2014-05-02 19:42:12] INFO  ruby 2.1.1 (2014-02-24) [x86_64-darwin12.0]
[2014-05-02 19:42:12] INFO  WEBrick::HTTPServer#start: pid=45782 port=56780
[2014-05-02 19:42:17] ERROR Encoding::UndefinedConversionError: "\xC3" from ASCII-8BIT to UTF-8
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/core_ext/object/json.rb:34:in `encode'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/core_ext/object/json.rb:34:in `to_json'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/core_ext/object/json.rb:34:in `to_json_with_active_support_encoder'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/json/encoding.rb:56:in `to_json'
    /Users/fabiopoloni/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/json/common.rb:223:in `generate'
    /Users/fabiopoloni/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/json/common.rb:223:in `generate'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/json/encoding.rb:96:in `stringify'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/json/encoding.rb:34:in `encode'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/json/encoding.rb:21:in `encode'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/core_ext/object/json.rb:37:in `to_json_with_active_support_encoder'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/formatter/json.rb:6:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/formatter.rb:33:in `block in after'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/formatter.rb:32:in `collect'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/formatter.rb:32:in `after'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/base.rb:25:in `call!'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/base.rb:18:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/error.rb:26:in `block in call!'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/error.rb:25:in `catch'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/error.rb:25:in `call!'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/base.rb:18:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/endpoint.rb:157:in `call!'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/endpoint.rb:145:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:152:in `block in call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:in `block in recognize'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:75:in `optimized_each'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:in `recognize'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/api.rb:537:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/api.rb:44:in `call!'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/api.rb:40:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-cors-0.2.9/lib/rack/cors.rb:54:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/lifx-http-0.2.3/lib/lifx-http/method_override.rb:19:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
    /Users/fabiopoloni/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
    /Users/fabiopoloni/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
    /Users/fabiopoloni/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
iphone.app-roved.com - - [02/May/2014:19:42:17 CEST] "GET /lights/all HTTP/1.1" 500 334
- -> /lights/all
CodingMinds commented 9 years ago

+1

entropin commented 9 years ago

+1

CWempe commented 9 years ago

+1