Script Runner - International characters in files won't load

FélixE March 7, 2013

I'm using Script Runner to launch a script post-function.

In the script there is several international characters such as "é"

My Linux box uses "ANSI_X3.4-1968" system enconding.

With Notepad++

  • if I encode the file in UTF8, the script won't load.
  • if I encode the file in AINSI, the script loads but the "é" appears as gibberish

Now, if I run the script on a JIRA instance on Windows, the System file encoding is "Cp1252" and:

  • if I encode the file in UTF8, the script won't load.
  • if I encode the file in AINSI, the script loads and "é" appears "é"

Which leads me to my question.

What can I do to make the script work on my Linux box. Do I need to change the system encoding, or is there JVM attribute I can add to setenv.sh ?

Thanks

2 answers

1 accepted

1 vote
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 7, 2013

It didn't work for me when encoded as UTF-8 with or without a BOM. With ANSI it did work but then I couldn't edit it in IDEA. With linux my script worked when pasting it in to the admin panel. Maybe related: http://groovy.329449.n5.nabble.com/Does-Groovy-support-UTF-8-encoded-scripts-td331787.html

As a (bad) workaround perhaps you could html-escape them, if displaying in the browser? Likely not possible though.

Setting -Dfile.encoding=UTF-8 may work... not tested.

2 votes
FélixE March 7, 2013

I replaced "é" by "\u00e9" and it worked.

Thanks Jamie

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events