Genesys CTI User Forum > Genesys-related Development
Problem of characters encoding with AIL
florence_c:
Hello,
We are currently developping a Java agent desktop using framework AIL v7.6.4.
We encounter some difficulties when retrieving the application options (using ailFactory.getApplicationInfo() method): options that have characters with accents (french language) are bad displayed (ex: "D?jeuner" instead of "Déjeuner").
The 'config' database is Cp1252 (MSSQL Server 2008 R2) and our Java application is UTF8.
Thanks in advance for your help.
Florence.
imaki:
Is it possible, that your application is outputting data on command prompt? That might be the problem..
Have you tried to write results to an utf-8 file?
Have you debugged the solution and can you see that the characters are really returned as [u]'?'[/u]?
florence_c:
Hi,
I have debugged by getting bytes of my string data (data.getBytes(charset_name)) trying various charset names. The result is that the byte code is always corresponding to an unexpected character. For example, for UTF-8 charset, I obtain 63, which corresponding to "?"
Here is an use case and some basic code snippet, if you want to reproduce this case :
1/ Have a config database with collate = French_CI_AS
2/ In CME, create new AIL application (type CLIENT or SERVER, no matter) and add the following section/options:
[motifs]
DEJEUNER=Déjeuner
3/ Create new Java project. Main code snippet is :
public void main(String[] args)
{
// ... init AIL connection ...
ApplicationInfo appInfo = ailFactory.getApplicationInfo();
Map appOpts = appInfo.mOptions;
Map test = (Map)appOpts.get("motifs");
System.out.println(test.get("DEJEUNER"));
}
4/ Run JVM with argument -Dfile.encoding=UTF-8 (mandatory for us)
5/ In console, see the result:
- expected => Déjeuner
- observed => D?jeuner
cavagnaro:
console can be messy...try an output as proposed and see what happens
florence_c:
Well, the first time we saw the problem, was not into the console, but into the textBoxes of our web application. So we are sure it is not a simple console issue.
I simplified the code snippet in order for you to reproduce the case, but the problem can be seen anyhow you display the data.
Navigation
[0] Message Index
[#] Next page
Go to full version