How can i change file encoding of generated baseLanguage

Hi,

i have a simple string with ä in a classfile like

string st = "Getränke";

and when i generate java it becomes:

"Getr\u00e4nke"... instead of "Getränke". Shouldn´t ä become simply c3 a4 in utf-8, whereas the lowercase "r" is simply 72?

Any hint appreciated,
dan
6 comments
Hi,

I'm not sure but the encoding is specified in the textgen of ClassConcept.

It is utf-8.
0
Hi Michael,

were did you find the encoding setting?

I can give a more detailed explanation of my problem. if i write

string st = "getränke" somewere in the baselang and i generate the text, i can view the outcome in the source_gen folder. right? I can open the *.java with the internal viewer but instead of "getränke" it is "Getr\u00e4nke". However, i can edit the string with the internal viewer simply to "getränke" again.

So i m wondering what i have to change to receive "getränke" directly as outcome in the *.java file ....

Any Idea?
Dan
0
As no-one else is responding to this thread, I do.

were did you find the encoding setting?


Press Ctrl+N and enter ClassConcept_TextGen. (Select the one with the T icon)
In the second line there is "encoding: utf-8".

But you cant change it here.
The issue also maybe from "StringTextGen" which is a component, that does escaping of characters in Strings.
There is a replaceNonAsciiSymbolsWithUnicodeSymbols.

Have you tried your java-application.
It should probably work anyway.
0
Ok i see,

seems to be indeed the StringTextGen component which replaces my "ä" to \\u .

But do i have any possibility to change that behavior?? The java code runs but the database cant handle it.

Dan
0
Then you maybe could file an issue request which states your problem on youtrack.

The only workaround is probably to write your own Generator that overrides the TextGen of the Classconcept. That should be possible.
If you have a generator that reduces the ClassConcept to something else this is executed before the TextGen.
0
Please file feature request for it.
0

Please sign in to leave a comment.