Im having trouble with Internationalizing my Eclipse RCP application for non-Latin characters.
I am storing Chinese characters in UTF-8 format in the property files. But reading them out does not work properly, they are all displayed like gibberish.
I am wondering if there is an easier way to do this, without overriding the provided NLS classes.
Properties files are normally encoded as ISO-8859-1 and it is not a good idea to override this. You can specify Unicode characters in the file using \uNNNN notation.
Related
We are using QT 5.5 successfully throughout our VC++ projects in VS2015.
Now, i am adding i18n thereto, using QTs Linguist tools to create my strings 2b translated and the resulting .qm files. I load the files through QTranslator object, the translation itself seems to work, but they get displayed wrongly.
As german is my mother tongue, I have to type several umlauts, beside any other special unicode-characters I definitely want to support.
As en example, I use linguist to translate over to über, and the resulting text in my application reads über. What I can surely recognize as an encoding mismatch.
I already had a look on the i18n example, which displays correctly for all of the provided languages, so I right now do not know what's wrong after I checked all file encodings.
Anyone any ideas? Or even has the same problems? Or had them but solved? Any suggestions were greatly appreciated!
This seems to be a Windows-specific problem.
Instead of using QString.toStdString() (what breaks the correct string), better use QString.toLatin1() at least for the languages to support yet.
For ecommerce web applications, I need to verify whether the correct currency symbol is displayed or not, depending on the country.
In the below site,
http://www.moltonbrown.co.uk/store/index.jsp
am checking for the currency symbol in the basket summary.
In Selenium IDE, when I do verifyText for xpath //div/span[contains(text(),'£18.00')], it runs well. But, when I use the same xpath in selenium webdriver automation code and try to verify the element, it displays:
//div/span[contains(text(),'�18.00')]
Element not found
false
***************
//div/span[contains(text(),'�18.00')]
*************
***************not present***************
I saw this get currency symbol using php . But couldnt understand what should be done to overcome this.
Thanks in advance,
Suchitra
The fact that your currency symbol is turned into a � indicates there is a character set issue that is causing your problem. From the web-driver documentation, there is "limited" support of unicode by using UTF-8. Limited probably means "buggy".
In any case, you should verify that that the file that runs this test is saved using UTF-8, and that the bytes for your currency symbol are correct for UTF-8. If this file is in some other character set, save it as UTF-8 and try again.
Here is somebody that had a similar problem with the ä character and python drivers. Sending unicode with Selenium Webdriver on python They were able to solve the problem by changing the declared character set of their python file.
I do not know what I changed, but today I can no longer build my site's front page with jekyll successfully. It is now complaining about:
[2012-10-30 14:22:10] regeneration: 1 files changed
Liquid Exception: incompatible character encodings: UTF-8 and ASCII-8BIT in index.html
And I'm at a loss to resolve the issue. I believe it's being introduced via a loop of posts I create on the front page, index.html, where I include an excerpt from the last 'n' posts. I used file(1) against my _posts/ directory, and do have some mixture in there:
_posts/2012-08-10-canned-responses-your-silent-partner.md: UTF-8 Unicode English text, with very long lines
_posts/2012-08-21-alternate-ssh-for-osx.md: UTF-8 Unicode English text, with very long lines
_posts/2012-08-21-appus-interruptus.md: ASCII English text
_posts/2012-10-25-emoryfocuslight.md: ASCII English text
_posts/2012-10-28-distributed-social-networking-with-tent.md: ASCII English text, with very long lines
I'm not sure if this is my problem, though. I use vim and bbedit to edit these files, and they're stored in Dropbox (I build/stage in my Dropbox folder but publish elsewhere). Most of my writing/editing is done on OS X.
When I search for this error message I get a lot of hits for rails applications or forcing ruby gems to use a specific encoding, I don't know if that is relevant or would even help me. Would love to be aimed in the right direction or be told how to resolve this situation. It's a sad state of affairs!
A fix is to use the configuration
Jekyll Configuration
Example
encoding: utf-8
No mention of UTF fix
Additionally, you might need to change the code page of the console window to UTF-8 in case you get a “Liquid Exception: Incompatible character encoding” error during the site generation process. It can be done with the following command:
chcp 65001
(From the jekyll "Installation for Windows page": http://jekyllrb.com/docs/windows/)
I have been struggling with this same issue lately and finally found out the root cause.
I went through all post files and noticed that the header matter in some old posts contained following:
title: !binary | {mime encoded string}
Propably the Wordpress migration script, which I had used,
encoded latin1 strings as !binary in YAML and this
caused "incompatible character encodings" error in my case.
I replaced those with correct UTF-8 strings and all went smoothly after that.
Sound daft but re install Jekyll. Then try and re compile your site.
Had a quick google search, bear in mind these are not for Jekyll but ruby so similar.
ruby 1.9 + sinatra incompatible character encodings: ASCII-8BIT and UTF-8
http://www.ruby-forum.com/topic/206925
What have you set the markdown to in your _config?
I'm running Jetty on OSX on my dev environment. Currently character encoding seems to be faulti (probably mac-roman), overriding Jetty default. How can I force the encoding to be UTF-8? This problem seems to appear only on OSX, linux/windows works fine.
I'm running Jetty from terminal so eclipse-specific solutions aren't of help.
Apparently I was wrong in blaming Jetty for this problem. The reason was maven and how maven brings in the default encoding java-settings.
Setting this env-variable seemed to solve the problem:
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
Answer found from here.
No problem here however we start Jetty from the javaWrapper (and which should not make a difference).
The only parameter I can see making an impact is setting the file.encoding System Property e.g. -Dfile.encoding=UTF-8
EDIT
( our macs locale are set to utf-8 )
To set the default character encoding for jetty you can set the system property 'org.eclipse.jetty.util.UrlEncoding.charset' to whatever you like. This will affect the encoding and decoding for either the query string of a URL or the content of a POST HTTP request.
Also, for a long time (maybe early 6.1.x timeframe) now this has been utf-8 by default so I am not certain this is the issue your are seeing.
So it is clear, jetty has been an eclipse project for a number of years now so that above system settings isn't an eclipse specific setting, it is just an artifact of our being at eclipse naming wise. :)
cheers
I'm facing a weird actions by codeiginter especially when it comes to using different languages. I had to translate some pages in the system/language/arabic and system/language/japanese as well and changed the chartset to UTF-8in the config.php file, but when I test it through the form validation for example, it gives me ????????? characters as if these languages are not recognized even by the unicode.
any idea how to get around this issue?
Thanks
ok, it urned out that I need to do some trick in here. For Arabic language I had to use unicoding html to make it like symbols then add them to my php or html. and it works perfect. For Japanese language, it is just adjusting unicoding in the config file at codeigniter. And that's it.