Umlaut symbols rendered as �
-
We're trying to render an HTML template with umlaut symbols (ö/ü/ä). As the result, we get � symbol in rendered HTML output.
I tried to replicate this issue in Playground but everything works there as expected https://playground.jsreport.net/w/sergioly/lkSOqsxG
We use the same version of JSReport as Playground -3.5.0
but in our case, it's the base Docker image with a few extensions. Here is our Dockerfile:FROM jsreport/jsreport:3.5.0 RUN npm install @jsreport/jsreport-postgres-store \ @jsreport/jsreport-xlsx
I assume that the issue is related to the fonts. And tried to install google fonts and
ttf-opensans
package but nothing helped.
Can you please give me a hand on this?
-
We're trying to render an HTML template with umlaut symbols (ö/ü/ä). As the result, we get � symbol in rendered HTML output.
In the HTML output? jsreport has no influence on that. Your client/browser deals with this. Maybe your browser client blocks the request to the google font. Check the F12 console if there are some failed requests.
-
@jan_blaha yes, in HTML output but the browser is not involved. We're making an API request to the JSReport instance to render the template and it returns HTML with � instead of correct symbols.
-
If run from the studio, does the browser display it correctly? If yes, the problem is on your client's side on how you read the response.
-
@jan_blaha can you please give me a hint on how to log render results on the JSReport side? I'll compare the results on both sides. Thanks!
-
-
@jan_blaha I passed
"reports": { "save": true }
to API and checked result on JSReport side.
Here is what I see injsreport_blob
table with the query:select convert_from(content, 'utf-8')::text as html from jsreport_blob where blobName='reports/data/dev/welcome_email/body.html/76f3836c-b5a9-4534-a446-dedb30221aea.html';
-
Can you go to jsreport studio, hit in the settings the reports, and then open the report?
-
@jan_blaha sure, here is what I got
-
Interesting, do you get the same without using postgres?
-
@jan_blaha I didn't try. We have a few instances of JSReport and we had issues with template synchronization through the file system across all instances and Postgres solved our problems
-
Yes, a full database is typically better for multi-instance in prod.
I've tried to replicate the problem closely to what you write, but without success.
I've done the following, please try the same or try to isolate the problem.
Dockerfile
FROM jsreport/jsreport:3.5.0 RUN npm install @jsreport/jsreport-postgres-store
Running it
docker run -p 5488:5488 -e store_provider=postgres -e blobStorage_provider=postgres -e extensions_postgresStore_host=host.docker.internal -e extensions_postgresStore_port=5432 -e extensions_postgresStore_database=jsreport -e extensions_postgresStore_user=postgres -e extensions_postgresStore_password=password myjsreport
Export from playground your shared workspace
Import fully into running appFrom the postman/advanced rest client, I send the following request
{ "template": { "name": "body.html" }, "options": { "reports": { "save": true } } }
Then I open back studio, check stored reports, and the encoding is correct.