Skip to content
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

Merged
merged 3 commits into from
Mar 11, 2020

Conversation

birgerhaarbrandt
Copy link
Contributor

Changes

Added explicit conversion to UTF-8.

  • First change

Related issue

Fixes https://github.com/ehrbase/project_management/issues/112

Additional information and checks

  • Pull request linked in changelog

@birgerhaarbrandt birgerhaarbrandt added the bug Something isn't working label Mar 5, 2020
@birgerhaarbrandt birgerhaarbrandt self-assigned this Mar 5, 2020
@birgerhaarbrandt birgerhaarbrandt requested review from ppazos and removed request for lmarcoruiz March 6, 2020 11:45
Copy link
Contributor

@ppazos ppazos left a 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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Geisterfalle please fix indentation

@birgerhaarbrandt
Copy link
Contributor Author

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).

@birgerhaarbrandt
Copy link
Contributor Author

@ppazos should be good now, please have a look

@ppazos
Copy link
Contributor

ppazos commented Mar 9, 2020

@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.

@birgerhaarbrandt birgerhaarbrandt merged commit 371873b into develop Mar 11, 2020
@wlad wlad deleted the feature/112_fix_utf8 branch September 7, 2020 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants