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

Special characters in properties #97

Open
krisrefs opened this issue Jan 17, 2022 · 3 comments
Open

Special characters in properties #97

krisrefs opened this issue Jan 17, 2022 · 3 comments

Comments

@krisrefs
Copy link

krisrefs commented Jan 17, 2022

Hey!

I have the issue that my special characters gets converted into unicode characters, and that will not work in our application.

Is there a way to bypass this? Or is there going to be a way to bypass this?

It's currently converting both keys and translations. (Notice I am using java properties files)

FYI; We are using self-hosted docker version.

@chrztoph
Copy link
Member

Hey, can you give an example for which special characters get converted into unicode characters? Unicode is more or less the standard so I would also be really interested how this breaks your application? 🙂

@krisrefs
Copy link
Author

We have characters like Æ Ø Å and other special languagespecific characters (like Chinese signs).

å fx. get's converted to \u00e5 and ø to \u00f8.

We expect those to come out as Æ Ø Å, both in keys as well as values.

In why this breaks our application, then it's because it can't find the key when a character is converted.

If you still want the conversion, maybe it could be a setting on the export config?

@chrztoph
Copy link
Member

Sorry for the late response.

The library we are using for exporting it to a Java .properties file automatically encodes special characters as it seems like it's best practice for .properties files (see https://github.com/jnbt/java-properties#encodings-and-special-chars and https://docs.oracle.com/javase/1.5.0/docs/api/java/util/Properties.html#load%28java.io.InputStream). Although it is not documented in the README it seems like this escape procedure can be disabled (see https://github.com/jnbt/java-properties/blob/master/lib/java-properties/generating/generator.rb). If this is the case I will add an option to disable this escape procedure but I can't give you a timeline on that. I'm open to pull requests.

Maybe there is a way it also works with escaped characters in your project as it seems to be best practice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants