Wrong characters encoding in packaged electron app - encoding

I have electron app using Vue / Nuxt
Dev build work perfect, but when electron app is packaged then utf-8 characters source files are wrong.
eg č is displayed as Ä even with default system font.
What is really weird is fact that same wrong character is display even if char is delared
as č in html template. Dev tools displays same malformed string in source instead.
Seems like build step do something wrong with it.
When user input č in app or č is loaded from external file in runtime, everything is ok.

Related

GWT internationalization accent characters not displaying correctly

I have a few different languages in a gwt project. For some reason the accent characters for locale_fr.properties works fine but the accent characters in locale_es.properties do not display correctly (show as "?" in a triangle). The host html page is encoding using utf-8 as well as the project .xml file, so it doesn't seems like the issue is with what type of encoding I'm using. Can't seem to figure out why the accent characters would work for one language but not another. No difference in how the .properties files are set up from what I can tell...any suggestions on what could be causing this issue?

Firefox Tomcat7 Cookie IllegalArgumentException

Tomcat 7.0.30
Firefox 15.0.1
Eclipse 3.7 & 4.2
I have recently installed Tomcat7.0.30 and since then I am having all kinds of problems with Firefox. (for example this one)
Right now I am getting a java.lang.IllegalArgumentException: Control character in cookie value or attribute. exception.
I have a plain html file:
<html>
<head><title>Test</title></head>
<body>Test htm</body>
</html>
This is what Firebug reports:
"NetworkError: 500 Internal Server Error - http://localhost:8080/WSTest"
The character encoding of the plain text document was not declared.
The document will render with garbled text in some browser configurations
if the document contains characters from outside the US-ASCII range.
The character encoding of the file needs to be declared in the
transfer protocol or file needs to use a byte order mark as an encoding signature.
What bothers me is that there are no problems whatsoever in chrome. The page just opens as I would expect it to...
I have tried to google this and the only suggestion I found was to add this:
org.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE=true
org.apache.tomcat.util.http.ServerCookie.ALLOW_HTTP_SEPARATORS_IN_V0=true
to the catalina.properties file, but that didn't help.
I'm really loosing my mind here.
Apparently the problem was with my Firefox installation. After exhausting all options and testing with Chrome, Safari, Opera and even IE, which all worked properly, I decided to uninstall Firefox with removing all profile settings and then re-install it again. The new installation works.
p.s. HINT: if you are uninstalling Firefox completely, don't forget to backup your bookmarks and passwords and save the list of your add-ons ;)
bookmarks can be backed up directly from Firefox
passwords can be stored with an add-on called Password Exporter
add-ons I "save" with a screenshot :D

UTF8 encoding problem, same results work fine in wordpress

I have a wordpress installation that clients can edit, all characters display ok. On the main homepage I query the same database for the same title and post content, but it doesn't display correctly - just a question mark
I have tried sending the utf8 headers manually, through htaccess and through meta tags. I have used SET name UTF8 (which turns the characters into the diamond symbol with a questionmark inside).
I genuinely cant figure out what it could be now and I really need these characters to display correctly.
Heres the homepage, you can see in the Sounddhism 6 preview that there are lots of question marks, if you click on it you will see what they are meant to look like
http://nottingham.subverb.net
I have passed it through the validator and it gives me this error:
Sorry, I am unable to validate this document because on line 373 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.
The error was: utf8 "\xA0" does not map to Unicode
Which, i appreciate is supposed to help me, but I don't know what to do about it. Especially since that line, the letter generating the error is supposed to be a space and is AFTER the offending question marks.
Can anyone help?
Compare the encoding of both the back-end scripts in Wordpress and also your homepage script. If you're using IE, right-click the page and check the encoding. Sometimes it's set to "Auto-detect" and IE will often detect a different encoding for different pages, causing strange issues like this.
If you're not using IE, try using a tool like Fiddler to see exactly what encoding (and what bytes are being sent back and forth both in the back-end and your homepage script.
If forcing UTF-8 on your homepage script doesn't work, I would guess that the back-end is not using UTF-8.

firefox addon development and Unicode

So I started developing my firefox addon.
Most of the work is performed by a referenced javascript file.
Problem is that when I edit some of the html elements on the page and say, set their text it's written as pure giberish. I am writing the text in hebrew. Can't for the life of me figure the reason.
Any ideas?
Javascript strings are already Unicode at runtime. However, you have to make sure that your files are encoded correctly.
Always use utf-8 (without BOM) file encoding for all your js, XUL, DTD, properties files to be sure.
Firefox might try to guess the file character set incorrectly otherwise, and even worse some stuff might not even try guessing the encoding and instead simply always assume utf-8.
Better yet, do not hard-code strings in js/xul, but use DTD/properties files for localization (XUL tutorial, XUL School).
This, e.g. snippet works pretty well for me (on this very page):
document.getElementsByTagName("h1")[0].textContent="русский язык";
(Just fire up the Firefox Web Console)
"Inline" hewbrew embedded in js files might create additional problems because it is right-to-left and bidi sucks, so the localization approach should be preferred.

iPhone - How to load Chinese text

I have a file with Chinese text that I want to use in my XCode project (I'm planning to load it through a database as it is lot of text), the problem is I don't know how to add the font to my project so that it's viewable when used on an iPhone?
Thanks :)
I currently live in China and deal with this all of the time. Usually the problem is not the font, it's the way the characters are represented. All unix variants use UTF-8 (most OSes) Windows uses UTF-16/32 (I forget). The cool thing about UTF-8 is that it is backward-compatible with ASCII. Open your text in the TextEdit or Firefox. In Firefox you can tell the browser to try different encodings, then save it to a file. If it is the wrong encoding, Mac TextEdit can convert between UTF-8 and UTF-16. Once you have the string in UTF-8 encoding, you can display it in your text field.
When displaying text to a textfeild make sure to display a UTF-8 string, not an ASCII string.
If you are interested in the details of UTF-8, just say so and I will expand on the UTF-8 design.
rw
The iPhone already has chinese fonts installed by default.
I've had some success using the FontLabel library. It allows you to use arbitrary .ttf fonts in your app and it's Apache-licensed:
http://github.com/zynga/FontLabel
For the majority of cases this has worked perfectly for me.