You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
API doesn't handle UTF-8 characters correctly. #43
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 literally title: '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 of JSON.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.
@bramp thanks it is working now, at last I got what you meant with this changes :)
Sorry for deleting comment. I didn't expect you to answer so quickly.
@bramp I encounter similar problem when use plotly.getImage API. I want to show Chinese character like follow: var figure = { 'data': [trace1], 'layout': { 'title': '标题' } };
but it can not show right character, just show some box. it seems due to lack of font in server, please help me. your help is greatly appreciated!
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.
"\u25B3"
I substitute that, but it's giving me the same error 500 - bad request. Help?
Activity
Ensure UTF-8 characters are encoded in \u0XXX notation, otherwise the…
bramp commentedon May 21, 2018
@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?
bartekadams commentedon May 21, 2018
@bramp thanks it is working now, at last I got what you meant with this changes :)
Sorry for deleting comment. I didn't expect you to answer so quickly.
a1019328562 commentedon Mar 20, 2020
@bramp I encounter similar problem when use plotly.getImage API. I want to show Chinese character like follow:
var figure = { 'data': [trace1], 'layout': { 'title': '标题' } };but it can not show right character, just show some box. it seems due to lack of font in server, please help me. your help is greatly appreciated!
shaedmorgan commentedon Dec 21, 2020
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.
"\u25B3"
I substitute that, but it's giving me the same error 500 - bad request. Help?