-
Notifications
You must be signed in to change notification settings - Fork 41
API doesn't handle UTF-8 characters correctly. #43
Comments
… server rejects the request. Fixes plotly#43.
@bartekadams did you try the patch in my pull request https://github.com/plotly/plotly-nodejs/pull/49/files ? And what exactly did you try, and what exactly didn't work? |
@bramp thanks it is working now, at last I got what you meant with this changes :) |
@bramp I encounter similar problem when use plotly.getImage API. I want to show Chinese character like follow: |
I'm having this same issue plotting the triangle figure as text (I don't like the plotly triangle markers, so I've been using this instead. |
I tried setting some math characters (e.g 'μ') in a title of a figure, like so:
However, when I call
plotly.getImage(figure, ...)
a error is returned and it looks like the server returned a "500 Internal Server Error".When I use the graph builder on the plot.ly site, I see that Chrome POSTs JSON in the form
title: 'Normal (\u03bc = 0, \u03c3 = 1.0)'
, however Node.js seems to send it literallytitle: 'Normal (μ = 0, σ = 1.0)'
. Reading the JSON spec, how Node.js is sending it is valid, however, hacking the plotly/index.js, and changing the output ofJSON.stringify
to use \u0XXX notation seems to work.So please either change your Node.js API to encode in a way that is suitable, or please change your server to accept all valid JSON.
The text was updated successfully, but these errors were encountered: