Skip to content
This repository has been archived by the owner on Aug 13, 2018. It is now read-only.

Incorrect encoding for cyrillic symbols #66

Open
fourslashw opened this issue Nov 24, 2016 · 2 comments
Open

Incorrect encoding for cyrillic symbols #66

fourslashw opened this issue Nov 24, 2016 · 2 comments
Assignees

Comments

@fourslashw
Copy link

When I trying to debug socket.io events addon shows event data in incorrect encoding

42["TURN_SWITCHED",{"turn":{"id":0,"number":0,"attackerSide":"NORTH","state":"ENDED","defenderId":null,"attackedField":[1,1],"targetOwnership":"NORTH","currentAttack":{"question":{"text":"�акое ме��о зан�ла па��и� ��езиден�а на в�бо�а� в �о��да���венн�� ��м� в 1995 год�?","answers":["I","II","III*","IV"]}}}}]
@eliihen
Copy link
Member

eliihen commented Nov 25, 2016

Hi,

Thanks for reporting. As you may have guessed, we don't use cyrillic much, so we're always happy to have people who do test the extension and report bugs :)

I'll have a look at this when I have time, which probably is either today or sometime next week. Stay tuned!

@eliihen
Copy link
Member

eliihen commented Nov 26, 2016

I can see that where we receive frames the received frame needs to be utf8 decoded twice in order to get a meaningful string.

@janodvarko is this a bug in the API or do we need to decode the frame twice for some reason?

STR:

  1. Place this line at the beginning of frameReceived in view.js console.log(decodeURIComponent(escape(decodeURIComponent(escape(frame)))));
  2. Build and run with jpm
  3. Open http://janodvarko.cz/test/websockets/ and the browser console
  4. Connect and send это or anything cyrillic
  5. In the browser console you see "это" printed because of the double decode console log, but the single decode we do in view.js only results in some binary stuff, as seen in the extension output

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants