I'm using jasper library v. 6.2.2 with Oracle ADF 11, our servers are running Red Hat 6
I'm facing an issue with the special characters like French accent "€ è é ê û â"
when I export the report as a PDF everything works fine but on the same environment when exporting the report as HTML output using SimpleHtmlExporterOutput I get bad charachters like this "è, é..."
i tried changing the encoding to UTF8 and cp1252 when calling the class SimpleHtmlExporterOutput but still facing the same issue,
Thanks in advance
i changed the JAVA_OPTIONS on weblogic start params adding -Dfile.encoding=utf8 and forcing weblogic to start with UTF-8 and this solved my problem
Related
With NetBeans 15 I can write characters like 'à' and 'è' in the editor but if I try to print them in the console they are not displayed and this also happens if I enter the ASCII code of the characters. If I compile and run the program manually everything is fine.
Resolved:
the problem rises on one of the changes implemented in Java 18 that is JEP 400: UTF-8 by Default. In it is stated: "Standardize on UTF-8 throughout the standard Java APIs, except for console I/O".
I have resolved adding (only for JDK 18)
if(!"UTF-8".equals(System.out.charset().displayName())){ System.setOut(new PrintStream( new FileOutputStream(FileDescriptor.out), true, StandardCharsets.UTF_8)); }
I have a problem with encoding characters when I'm trying to run test. I'm using Symfony 4 framework with package symfony/phpunit-bridge.
I'm running test by command like below:
php bin/phpunit tests/WhovianTest.php
The results looks like below:
As we can see there is a problem with encoding in test's results. I'm using windows 10 operating system and PHPStorm IDE.
How could I solve this problem?
I would be grateful for help.
A standard Windows 10 shell has some issues with the ANSI control characters that are used to display colors (they are quite recognisable with the ?[31; characters being displayed). There are some packages to add them, or you can just turn them off.
The phpunit docs suggest:
On Windows, use ANSICON or ConEmu
Alternatively, you can set colors="false" in the opening tag of your phpunit.xml, or as a command line parameter: --colors=never (try auto as well).
I am writing an Eclipse Plugin. All my source files are encoded as UTF8 (Alt+Enter shows "Text file encoding: UTF8").
When I run my plugin using "right click -> Run as eclipse application" everything works fine.
However, when I install my plugin using an update site in another (but identical, i.e., copied) Eclipse application, German Umlauts (Ä Ö Ü...) get messed up in all SWT-controls, but not in String constants.
Example:
public class MyWizard extends Wizard{
public NewEntityWizard() {
super();
setWindowTitle("This will NOT work: Ä");
}
public void foo() {
String contents = "This WILL work: Ä";
ByteArrayInputStream stream = new ByteArrayInputStream(contents.getBytes());
// write stream to file test.txt
}
The window title will show up as: "This will NOT work: ä"
When opening the file test.txt in Eclipse, with UTF8 encoding, it will contain the correct test: "This WILL work: Ä"
Both will work when run by using Run as, i.e., when not installing the plugin.
How do I resolve this?
I figure, the compiled plugin / bin files might (correctly) be encoded in UTF8, but read in a different encoding by the second Eclipse installation. If so: How do I tell the JVM / Eclipse to read the Plugin's bin files in UTF8?
Any help is appreciated.
Solved the problem myself. The issue was a Bug in Eclipse (I am running Oxygen, not sure if the problem exists in other versions).
The bug was, that the PDE Builder, which builds the product, does not respect the encoding settings configured in Eclipse. It uses the default encoding of the plattform, which is not UTF8. This seems to be a Windows only problem. The java builder does not suffer from this bug, that's why the problem did not occur during testing.
Bug Description:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=516656
Solution:
As workaround I added the following line to the eclipse.ini of the building Eclipse installation, build the product again and installed it again. The setting makes UTF-8 the default encoding for the whole VM.:
-Dfile.encoding=UTF-8
This solved the issue.
I just deployed my Tapestry 5 app on Jetty 9 web server, running on Debian Squeeze. I have problem with encoding. I can't see Serbian letters (šđčćž). For example, I see "Dobrodošli" as "Dobrodo??li". You can check it out HERE. As I know, Tapestry by default works with UTF8, on Debian locale is set SR Latin UTF8, and on Jetty I can't find any config setting where I could set it. I did the same thing local on my PC (Ubuntu 12.10), and everything works great.
Can you help me please? How to solve this problem, I don't know what I did wrong?
Thanks in advance.
Did you try setting value for tapestry.charset.
The character encoding used when generating output (or parsing input).
The default is "UTF-8".
For details checkout http://tapestry.apache.org/configuration.html
I'm using the code in this example example and in the runUpdate() function which i put in a javabean in a web application in Netbeans 6.8 with Glassfish v3.
It seems i have an encoding problem because question marks appear in the table.
I have tried so far:
In nbproject->private->private.properties add runtime.encoding=UTF-8>
In project->properties->sources->encoding utf-8
In program files->netbeans->etc->netbeans_conf in netbeans_default_options i add -J-DFile.encoding=UTF-8
In project->properties->build->compiling->additional compiler options -encoding utf-8
In sun-web.xml i added <locale-charset-info default-locale="UTF-8">
<locale-charset-map locale="" charset=""/>
<parameter-encoding default-charset="UTF-8"/>
</locale-charset-info>
Also when i use system.out.print() in the glassfish output panel i get gibberish.
I'm in the last level of madness please take a look.
Thank you.
EDIT
Also when i do listing .5 i get a glassfish error:
WARNING: WEB0500: default-locale attribute of locale-charset-info element is being ignored
Have you tried using glassfish-web.xml instead of sun-web.xml ?
To change default Glassfish POST fields encoding, I put this to WEB-INF/glassfish-web.xml, and it worked (I use glassfish 3.1.2):
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD
GlassFish Application Server 3.1 Servlet 3.0//EN"
"http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
<parameter-encoding default-charset="UTF-8" />
</glassfish-web-app>
I'm not sure if it will help you, but may help other people having the same problem as me.
Glassfish uses ISO-8859-1 encoding by default. See http://download.oracle.com/docs/cd/E19798-01/821-1752/beafu/index.html for more information.
Are you sure your browser is set to UTF-8. By default most browsers do not display in UTF.
Start with the browser and work backwards. Is your datasource storing the data in UTF-8? By default Java is in UTF-8 so I am not sure that GF is your real issue.