-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added explicit UTF-8 encoding when reading to byte #173
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Geisterfalle this change seems OK, can't reproduce the issue since there are no examples provided, also there are no mentions of the environment in which this issue happens or what is the error returned (I'm viewing the issue https://github.com/ehrbase/project_management/issues/112).
Also, I detected other areas where getBytes happen, not sure if that should be also changed: https://github.com/ehrbase/ehrbase/search?q=getBytes&unscoped_q=getBytes
@@ -123,7 +121,7 @@ void setOptPath(String optPath) { | |||
public void storeTemplate(OPERATIONALTEMPLATE template) { | |||
XmlOptions opts = new XmlOptions(); | |||
opts.setSaveSyntheticDocumentElement(new QName("http://schemas.openehr.org/v1", "template")); | |||
saveTemplateFile(template.getTemplateId().getValue(), template.xmlText(opts).getBytes()); | |||
saveTemplateFile(template.getTemplateId().getValue(), template.xmlText(opts).getBytes(StandardCharsets.UTF_8)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Geisterfalle please fix indentation
Thanks Pablo. You can use any template and when there are no JVM parameters or environment variables provided, the upload fails on system were UTF-8 is not standard encoding (windows, some Linux distributions). |
@ppazos should be good now, please have a look |
@Geisterfalle I'm not running the system with an encoding parameter, in fact I never did, and didn't got errors when uploading templates on my environment, so I can't reproduce since I don't have the same env. |
Changes
Added explicit conversion to UTF-8.
Related issue
Fixes https://github.com/ehrbase/project_management/issues/112
Additional information and checks