I'm currently using Eclipse with TestNG running selenium webdriver with java. I am using Jexcelapi to import data from OpenOffice (spreadsheet) to compare strings on the website i'm testing with values in the spreadsheet. The problem I have is that we have different regions including germany and Nordics (Sweden, Norway and Denmark). These sites have string characters with accents special characters. This is copied correctly on my spreadsheet and running the scripts in debug mode shows the correct character from the spreadsheet but when i get my results, it displays invalid characters such as ? and whitespace. I have looked through the forum and searched everywhere for the past few days and seen various solutions but none seemed to work. I'm not sure if the problem is with Eclipse, Jexcelapi or OpenOffice.
I changed the encoding settings in Eclipse to UTF-8 as advised in some places but still the same problem. I instantiated the class 'WorkbookSettings' and set the encoding and used it with my getWorkbook method and I still get those bad characters that make my scripts show failures.
Can anyone help with this please?
Thanks in advance
We had a similar problem when running webdriver on a remote machine and trying to paste text into forms. The tests were working on our development machines.
The solution was setting the environment variable
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF8
After that the webdriver copied with the right encoding for swedish characters.
Related
I'm working on a legacy project where we use Java 6 with Spring, Grails, etc.
The problem I'm running into, is that I have an file upload form, where we support support German filenames.
In this case I have a file named something with "für" and I'm having difficulties with that now.
I have tried converting it to unicode to see if that solved the problem but I am now able to see why there's a problem.
On Mac Chrome, it produces U+308 while on Mac Safari it produces U+00FC, with Safari it works and inserts correctly in MySQL, the other one fails.
The error from MySQL:
#1366 - Incorrect string value: '\xCC\x88r' for column `name` at row 1
When I try running this code:
UPDATE `X` SET `name` = 'für' WHERE `skabelon`.`id` = 1302
Why is there a difference and how can I fix it so it'll work with Chrome on Mac? Windows and Ubuntu Chrome works flawless.
UPDATE
It's now working after Normalizing the string.
It worked after I put it through normalizing in Java. Never knew that I needed that before now.
I used the Normalizer from java.text
Normalizer.normalize("String", Normalizer.Form.NFC)
I have looked everywhere on the web to see if anyone posted a similar issue but not been so lucky. I am running automation tests scripts using Java with Cucumber JVM. I have a step that involves verifying a Korean character but when I try to run it, i get a cucumber.runtime.CucumberException: Error parsing feature file
Does anyone have a suggestion about this? It's imperative i use that character as part of my input as it's verifying a site based in Korea.
Hope that is clear enough.
Thanks in advance
You need to add # language: ko in your feature file (the very first line)
So I have an application written in JavaFx 2.2 that has been packaged for linux, mac, and windows. I am getting a strange issue with some of the text fields though. The application will read a file and populate some labels based on whats found in the file. When run on ubuntu or mac we get a result like as you can see we have that special accent character over the c and it looks just fine. However in Windows it shows up like this . Any idea as to why this is happening? I was a bit confused as it is the same exact application on all three. Thanks.
Make sure to specify character encoding when reading the file, in order to avoid using the platform's default encoding, which varies between operating systems. Just by coincidence, the default on Linux and Mac happens to match the file encoding and produces correct output, but you should not rely on it.
In order to convert docx-files to pdf (or pdf-a to be precise), we are using JodConverter along with LibreOffice. This has been working fine for a week or so, but then suddenly all letters were representet as squares (usually indicating some control-sign) in the converted pdf (the word-file looked fine). After restarting the service for LibreOffice, things went back to normal, and letters were output just fine.
But we were left worried, as we have no guarantee that it won't happen again. I also have no idea why this happened, we had some troubles in the environment prior to this, but none on the server doing the docx-to-pdf convertion in particular.
Has anyone else encountered this problem, or a theory as to why it occured?
I have no theory as to why it occured, but I recommend using SoftMaker FreeOffice instead of LibreOffice. All included apps offer direct pdf export and it works excellent. Btw., if you have to exchange documents with Microsoft Office users: this is the office suite with the best interoperability on the market. You get from this website for either Windows or Linux without charge: freeoffice.com/en
I have a java application which has a GUI in both English and French, using the standard Java internationalisation services. I wrote it in JBuilder 2005 on an old machine, and recently upgraded, which has meant changing IDEs. I have finally settled on IntelliJ.
However, it doesn't seem able to handle the accented characters in my ListResourceBundle descendants which contain French. When I first created the IntelliJ project and added my source (which I did manually, to be sure nothing weird was going on behind the scenes), I noticed that all the accented characters had been changed into pairs of characters such as é. I went through the code and corrected all of these, and assumed that the problem was fixed.
But I find on running the (rebuilt) project that the pairs of characters are still showing, instead of the accented characters that I see in my code!
Can someone who has done internationalisation in IntelliJ please tell me what I need to do to fix this?
PS: I'm on the Mac.
Two things --
First, make sure your files are being stored as UTF, and that your source control supports the encoding.
Second, consider using the resource bundle editing support built into IntelliJ http://www.jetbrains.com/idea/features/i18n_support.html
Java resource bundles should only hold ascii and Unicode escape codes
see [http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/].
e.g. \u00d6ffnen for German Öffnen.
The command line tool native2ascii converts from your native format to ascii plus unicode escape codes. It is a bit of a hassle but not an Intellij but a Java problem.
Note: I use Intellij on a Mac to create programs localized in English, German and Japanese.