No accents in an utf-8 webservice - utf-8

I'm developing a webservice written in C and hosted by a RedHat 6.3 box. The box locale is fr_FR.UTF-8.
When I curl my webservice from the command line, I can read text content contaning accents on the command line.
However, when I check the WS output through the Chrome Developer tools and in the webpage output, the accents are replaced by a square containing an interrogation mark.
The content type of the webservice output is application/json; charset=utf-8.
The webpage charset is utf-8, browser is in autodetect.
What did I miss that unables me to properly display accents with utf-8 ?

I solved this by checking the way the accented content was generated. Actually mine was generated by Postgresql, whose configuration parameter client_encoding was set to ascii, un changed client_encoding to 'UTF8', thsi solved my issue.

Related

How to get firefox to read UTF-16 JSON

Ok so I got a web server serving UTF-16 jsons.
UTF-16 needed so don't even dare to answer "why don't you switch to UTF-8".
Apparently firefox can't read them.
In fact i get a JSON.parse error...
I tried switching to UTF-8 to prove that's the problem and it works...
but how can i make it successfully decode UTF-16?
my response headers charset is already "UTF-16"
The answer is you can't... Not with up to date versions of Firefox at least....

InvalidByteSequenceError in a ruby/rack web app with chinese characters

In my Ruby/Rack app I have static characters from Chinese and Japanese, in the ruby code and HTML views. When I'm running my app, I get an exception:
Encoding::InvalidByteSequenceError at /
/my_app/index.html.erb is not valid US-ASCII
It happens only on a production server, on locally -- not.
My local machine -- Linux, remote server -- FreeBSD.
I've tried "save with encoding --> utf-8" but it didn't help.
I'm not using encode/decode function in ruby code -- those characters are just statically embedded in my files.
This might be a problem with String input encodings. Strings you receive via params for example.
I had to enforce the encoding to UTF-8 via:
"Some String".force_encoding("UTF-8")
which stopped the error messages.

URL does not in IE11 but it does work in IE10

I've found an issue when accessing to an URL related to special characters. The URL is generated in JS with many parameters. When the redirection is processed in IE10 the URL works fine. This is the parameter with the special character and that causes the problem:
nacional=Espa%C3%B1a
but when the same process is executed in IE11 the same parameter looks like this. As you can see it is not encoded in UTF-8
nacional=España
I've tried to change in IE the encoding and the UTF-8 link properties and it didn't work.

UTF8 filename failing in IIS

I have an element in a web page containing a UTF-8 encoded filename URL
<A HREF='http://server/site/%E8%A8%82%E8%B2%A8%E6%97%A5%E7%B5%90%E5%A4%B1%E6%95%97.txt'>訂貨日結失敗.txt</A>
This returns a 404 page from IIS. The file exists in the correct location on the server.
When I monitor what IIS is looking for using ProcMon, I can see it attempting to find a file that looks like the raw bytes from the UTF-8 string rather than the UTF-16 (?) string.
Ȩ‚Ȳ¨Æ—¥ÇµÅ¤±Æ•—.TXT
I'd have thought IIS would have done the UTF-8 to UTF-16 conversion to look for the filename on the server.
Any ideas where I'm going wrong.
Ta,
J
Looks like I need to use IIS 6 as a minimum. I've just tested it and it seems to work OK. msdn.microsoft.com/en-us/magazine/cc301710.aspx

Zend_Soap client and SoapServer UTF-8 encoding problem

The site works on one server and DB on the other server. When I enter on site text to submit to DB on non english letters, it saves and ther render corect. For example if I enter "Привет Всем" I will see the same text on the site when display.
All MySQL collation as table as fields are utf8_general_ci
Meta content-encoding on the page also utf-8 as on site as on phpMyAdmin
Although if I access DB with phpMyAdmin I see КонÑтнатин ПаÐ
If I change it to Привет Всем then on the site I see ???????? ????
It was not working like this on our local test on 2 different servers with Windows on them. But after deploy to centOS online server it bacome work like this.
Looks like it double encode text to UTF-8. I cannot find where is it.
Zend_Soap_Client:: or SoapServer:: or MySQL encoding.
I rejected idea of Mysql because I though that if it is MySQl then it saves wrong, and then when it extraxts it should send wrong data.
Perhaps you should try to configure Zend_Soap_Client or SoapServer to use utf8?
In case of Zend_Soap_Client it can be done like this:
$client = new Zend_Soap_Client("http://my.site/my.wsdl", array('encoding' => 'UTF-8'));

Resources