10 messages in com.googlegroups.google-gadgets-apiRe: Problems with windows-1251| Subject: | Re: Problems with windows-1251![]() |
|---|---|
| From: | labtopia (mcco...@gmail.com) |
| Date: | 04/19/2007 09:17:30 AM |
| List: | com.googlegroups.google-gadgets-api |
Hi,
As it currently stands, gadgets only work with UTF-8. There is no way to pass in a different encoding, unfortunately. The API itself offers no workaround. Apologies, and hopefully this will be rectified soon.
Katie
On Apr 19, 12:37 am, teshca <Nick...@gmail.com> wrote:
labtopia, how do you know about plans? I saw my own eyes that inside the API this ability exists. Or it is only for internal purposes?
I can't convert returned file into UTF-8 manually. The problem occuared somewhere deep inside google API. When they try to read windows-1251 file with utf-8 reader. Some symbols in windows-1251 have codes that don't allowed in utf-8 charset, so utf-8 reader replace that "bad" symbols with code 65535.
As a result when I get response from _IG_FetchContent() all the russian symbols have the same code. And there is no way to make back transformation becouse information already lost.
On 19 апр, 02:26, labtopia <mcco...@gmail.com> wrote:
Hi,
The gadgets environment is UTF-8-only. The long term goal for the Gadgets API is to convert most _IG_FetchContent() results from their original encoding to UTF-8. However, this isn't in place yet.
There is not a way to pass an encoding through _IG_Fetch..., and there are no plans to make this available.
The only workaround that I can see for now is to manually convert returned content to UTF-8. Hopefully, a better solution will be available soon.
Best,
Katie (Google employee)
On Apr 18, 12:31 am, teshca <Nick...@gmail.com> wrote:
The only possible solution I see is to wait while Google implement ability to pass encoding into _IG_FetchContent function. I am sure that they know about this problem and will fix it soon :)
On 12 апр, 10:55, "Michael" <fj4s...@temporaryinbox.com> wrote:
Just one more suggestion. Try ISO-8859-5 instead of utf-8.
On Apr 12, 8:48 am, "teshca" <Nick...@gmail.com> wrote:
Michael, I don't think you are right. For example I want my gadget to work with files in different encoding (windows-1251 and KOI-8R for example) So, what encoding should I use in my gadget?
In fact, the problem deeper than I thought at the beginning. If I have two .txt files with different encoding,and I use _IG_FetchContent to get both of these files. I had no way to specify encoding of each file separately.
I looked at _IG_FetchContent function with Microsoft Javascript Debugger; And I find that _IG_FetchContent has third argument (not only url and callback function) This third argument contains addition information about request (header, encoding etc.) So I tried to pass that parameter like this : _IG_FetchContent(url, callbackfunction, {encoding:"windows-1251"}) But this didn't work. I think that this functionality not implemented yet on server side.
May be someone form Google teem who writes that API can answer my question. How can I pass encoding to _IG_FetchContent function?
On 11 апр, 22:07, "Michael" <fj4s...@temporaryinbox.com> wrote:
I think, if you declare your gadget use utf-8, it expect then your data is also in utf-8. Otherwise declare your gadget with another encoding. Look at examples in your language.
On 11 Apr., 14:10, "teshca" <Nick...@gmail.com> wrote:
The same problem I have when I try to get text content. I can't get text file with _IG_FetchContent function if this file isn't UFT-8 encoded. For example I can't get simple html text "http://www.mail.ru" both on IE and Firefox. Every russian character replaced with strange one.
On 11 апр, 13:11, "teshca" <Nick...@gmail.com> wrote:
This problem looks like bug in Google Gadget API I tried to get this xml "http://www.cbr.ru/scripts/XML_daily.asp" and I had the same result. I suppose that this problem isn't only with "windows-1251" encoding. I think that this problem occured with any encoding except "UTF-8". Did anyone work with not UTF-8 encoded xml files? Did you get the same result?
On 9 апр, 12:18, "Bagum" <Vadi...@gmail.com> wrote:
Hi everyone! I've got a problem with russian symbols while parsing an XML file. The coding of XML is "windows-1251". I use _IG_FetchXmlContent() to retrieve the XML file as a DOM tree. But when i try to display fields containing russian symbols, i can see only hieroglyphs. Other fields are displayed correctly. Moreover, this problem exists only in Opera and Firefox. In Internet Explorer everything is displayed properly.
I think it is caused by mismatching of codings in the gadget (UTF-8) and remote XML file (windows-1251), but i don't understand what i have to do to solve this problem.
Anyone knows?




