When I rendering data with chinese or japanese to a Firefox websocket client, it causes these:
shared/bundle/ruby/1.9.1/gems/cramp-0.15.1/lib/cramp/websocket/protocol10_frame_parser.rb:199:in `send_frame': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
from shared/bundle/ruby/1.9.1/gems/cramp-0.15.1/lib/cramp/websocket/protocol10_frame_parser.rb:203:in `send_text_frame'
from shared/bundle/ruby/1.9.1/gems/cramp-0.15.1/lib/cramp/action.rb:77:in `render_websocket'
from shared/bundle/ruby/1.9.1/gems/cramp-0.15.1/lib/cramp/action.rb:14:in `render'
I tried modify the line to frame.force_encoding('utf-8') and it works fine,
but I'm not sure is that the best solution?
When I rendering data with chinese or japanese to a Firefox websocket client, it causes these:
I tried modify the line to
frame.force_encoding('utf-8')
and it works fine, but I'm not sure is that the best solution?