Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Russian symbols are incorrectly gets from properties file through the i18nHelper in my Jira plugin.

Arthur Foss May 24, 2018

Hello, I have a problem with getting the Cyrillic characters.

This is my property file:

#put any key/value pairs here
duedate.job.cron=0 10 20 ? * MON-FRI
text.rus=тест текст

This is the Java code that gets the property:

final I18nHelper i18nHelper2 = ComponentAccessor.getI18nHelperFactory().getInstance(Locale.getDefault());
final String property = i18nHelper2.getText("text.rus");

libraries that I use

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.util.I18nHelper;
import java.util.Locale;  

Here is a screenshot of what jira getting in debug:

screanProp.png

The workaround is to replace the text with Unicode characters:

text.rus=\u041D\u0435\u043A\u043E\u043D\u0441 \u0438\u0441\u0442\u0435\u043D\u0442

 But this does not completely suit me.

 

Property file encoding is utf-8.

jira version 7.4

1 answer

0 votes
Arthur Foss May 25, 2018

I found this guide about internationalization.: https://developer.atlassian.com/server/framework/atlassian-sdk/internationalising-your-plugin/

It says - "Please Note: If you any of your translations use non-ASCII characters, which will include most languages other than English, then you must convert your text file to a Unicode-encoded ASCII text file using a tool such as native2ascii."

For this reason, all non-English characters are must be replaced by their Unicode. 

After all, java and utf-8 can support the Cyrillic, but in jira it is not possible(( Can someone explain why? At what level does this limit appear? 

Suggest an answer

Log in or Sign up to answer