mzubairsaleem / gtranslate-api-php

Automatically exported from code.google.com/p/gtranslate-api-php
GNU General Public License v3.0
0 stars 0 forks source link

Unexpected Character Encoding. #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Translating english to german, french and spanish.

What version of the product are you using? On what operating system?
Version 0.7.4, Linux OS.

Please provide any additional information below.

I have translated the text on the google translate page that has been put into 
the api and the api has been providing a different special characters than that 
of the translate page. I have set the header in the translate page to UTF-8 and 
also in the php file I have set the returned value to be encoded into UTF-8 
using utf8_encode() however the special characters that are being returned are 
mostly these ¤ © ± and the squiggly f. These glyphs are not 
being produced from the conversion on the translate page and I wondered if it 
was something that was part of the API that I could change?

Thanks.

Original issue reported on code.google.com by interbre...@gmail.com on 27 Oct 2010 at 8:17

GoogleCodeExporter commented 8 years ago
Additional: The text trying to be translated into the three languages is:

All canopies are aerodynamically designed and ideal for the commercial or 
leisure use.

this output into french gives the translation:

Les auvents sont aérodynamiquement conçu et idéal pour l'utilisation 
commerciale ou de loisirs. 

The output on the google translate page gives the text:

Les auvents sont aérodynamiquement conçu et idéal pour l'utilisation 
commerciale ou de loisirs.

Notice that the special chars are completely different?

Original comment by interbre...@gmail.com on 27 Oct 2010 at 10:20

GoogleCodeExporter commented 8 years ago
Hey there,
try encoding the string to translate into utf-8 before translation

Original comment by Vicof...@gmail.com on 29 Oct 2010 at 9:00

GoogleCodeExporter commented 8 years ago
I have just tried to convert the string to UTF-8 before the translation to no 
avail. Any other suggestions would be greatly appreciated.

Original comment by interbre...@gmail.com on 1 Nov 2010 at 11:41

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Sorry, scratch that last comment. I was still converting the string at 
translation level. It is working great now. Thanks. Additional if anyone is 
having this issue and using htmlentities in PHP this function will put the 
wrong chars in, use htmlspecialchars it works much better.

Original comment by interbre...@gmail.com on 1 Nov 2010 at 12:01

GoogleCodeExporter commented 8 years ago
That means is not an issue? Was a integration issue on your side ?

Original comment by josedasilva on 26 Nov 2010 at 4:16

GoogleCodeExporter commented 8 years ago
Assuming an integration issue by the user

Original comment by josedasilva on 1 Jan 2011 at 2:58