Identical requests and headers to same server from two different platforms get as response two diferent encodings:

From Win7 PC I get UTF-8 which is what I want.

From Raspberry pi I get ASCII-8bit. After encoding response to UTF-8 it becomes corrupted.

resp['Content-Type'] = application/json

Ruby version on both devices and raspbian version:

ruby 2.2.4p230 (2015-12-16 revision 53155) [armv7l-linux-eabihf]
ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]

Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux

Setup Considerations:

Connecting via SHH PuttY
Connections made from raspberry pass through an external proxy. 

Why is data not UTF-8?


This may be worth checking :

Go to your Raspberry Pi config window, and under localization, click Locale and see if your character set is set to UTF-8

  • Yes. My locale is UTF-8 – Antoni C Sep 29 '17 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.