原型,Safari和日本问题? [英] Prototype, Safari and Japanese problems?

查看:146
本文介绍了原型,Safari和日本问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个客户端/服务器应用程序,似乎在OS Firefox和

Windows IE和Firefox中运行良好。


但是,在OS X Safari中,虽然UI /通信本身可以正常工作,但如果来回发送的字符是日文的,那么它们将从服务器moji返回烤" (已损坏)。


任何人都有任何想法为什么这可能在Safari中的工作方式不同于

Firefox或IE?


谢谢!


doug

I''m working on a client/server app that seems to work fine in OS Firefox and
Windows IE and Firefox.

However, in OS X Safari, although the UI/communications themselves work
fine, if the characters getting sent back and forth are in Japanese they
come back from the server "moji bake" (corrupted).

Anybody have any ideas why this might work differently in Safari than in
Firefox or IE?

Thanks!

doug

推荐答案




Doug Lerner写道:



Doug Lerner wrote:

但是,在OS X Safari中,虽然UI /通信本身工作正常,但如果来回发送的字符是用日语他们从服务器回来moji bake。 (已损坏)。
However, in OS X Safari, although the UI/communications themselves work
fine, if the characters getting sent back and forth are in Japanese they
come back from the server "moji bake" (corrupted).




考虑使用UTF-8编码的Unicode字符,并确保

服务器发送一个HTTP标头声明例如

Content-Type:application / xml; charset = UTF-8

或者如果你发送纯文本,那么例如

Content-Type:text / plain; charset = UTF-8

我假设您使用XMLHttpRequest发送和接收数据,上面的

responseXML或responseText都应该可以正常工作

(虽然我不熟悉Safari实施的细节)。


-


Martin Honnen
http://JavaScript.FAQTs.com/




在1/18/06 10:05 PM,在文章中

43 ***************** ****** @ newsread2.arcor-online.net," Martin Honnen"

On 1/18/06 10:05 PM, in article
43***********************@newsread2.arcor-online.net, "Martin Honnen"
<ma*******@yahoo.de> wrote:
Doug Lerner写道:

Doug Lerner wrote:

但是,在OS X Safari中,虽然UI /通信本身可以正常工作/>很好,如果来回发送的字符是日文的,他们将从服务器回来moji bake。 (已损坏)。
However, in OS X Safari, although the UI/communications themselves work
fine, if the characters getting sent back and forth are in Japanese they
come back from the server "moji bake" (corrupted).



考虑使用UTF-8编码的Unicode字符,并确保
服务器发送HTTP标头声明例如
Content-Type:application / XML; charset = UTF-8
或者如果你发送纯文本,那么例如
Content-Type:text / plain; charset = UTF-8
我假设您使用XMLHttpRequest来发送和接收数据,上面的
responseXML或responseText都应该可以正常工作
(虽然我不熟悉Safari的细节)实现)。



Consider to use UTF-8 encoded Unicode characters and make sure the
server sends a HTTP header declaring e.g.
Content-Type: application/xml; charset=UTF-8
or if you send plain text then e.g.
Content-Type: text/plain; charset=UTF-8
I assume you use XMLHttpRequest to send and receive data, with the above
both responseXML or responseText should hopefully work correctly
(although I am not familiar with details of the Safari implementation).




感谢您的回复。


就我而言,返回数据并未用于替换整个HTML

页面,它用于为< div>设置innerHTML。标签。因此,在这种情况下发送

HTTP标头是不合适的,是吗?


整个页面本身的字符集已经正确。


对此有何想法?


谢谢!


doug




Doug Lerner写道:

Doug Lerner wrote:
On 1/18/06 10:05 PM,in article
43 ***********************@newsread2.arcor-online.net,\"Martin Honnen
< ma ****** *@yahoo.de>写道:
On 1/18/06 10:05 PM, in article
43***********************@newsread2.arcor-online.net, "Martin Honnen"
<ma*******@yahoo.de> wrote:
Doug Lerner写道:

Doug Lerner wrote:

但是,在OS X Safari中,虽然UI /通信本身可以正常工作/>很好,如果来回发送的字符是日文的,他们将从服务器回来moji bake。 (已损坏)。
However, in OS X Safari, although the UI/communications themselves work
fine, if the characters getting sent back and forth are in Japanese they
come back from the server "moji bake" (corrupted).



考虑使用UTF-8编码的Unicode字符,并确保
服务器发送HTTP标头声明例如
Content-Type:application / XML; charset = UTF-8
或者如果你发送纯文本,那么例如
Content-Type:text / plain; charset = UTF-8
我假设您使用XMLHttpRequest来发送和接收数据,上面的
responseXML或responseText都应该可以正常工作
(虽然我不熟悉Safari的细节)实现)。



Consider to use UTF-8 encoded Unicode characters and make sure the
server sends a HTTP header declaring e.g.
Content-Type: application/xml; charset=UTF-8
or if you send plain text then e.g.
Content-Type: text/plain; charset=UTF-8
I assume you use XMLHttpRequest to send and receive data, with the above
both responseXML or responseText should hopefully work correctly
(although I am not familiar with details of the Safari implementation).



感谢您的回复。

在我的情况下,返回数据不会被用来替换整个HTML页面,它用于为< div>设置innerHTML标签。因此,在这种情况下发送
HTTP标头是不合适的,是吗?

整个页面本身的字符集已经是正确的。

任何关于这个的想法?



Thanks for your response.

In my case, the return data is not being used to replace an entire HTML
page, it is being used to set the innerHTML for a <div> tag. So sending the
HTTP header wouldn''t be appropriate in this case, would it?

The charset for the entire page itself is correct already.

Any thoughts about this?




AFAIK浏览器页面是一个单一编码。因此你不能在$ -8859-1中显示一个段落,而在另一个段落中显示Shift_JIS。这个

是最初需要Unicode的原因。您是否尝试以UTF-8提供整个

页面,包括任何进一步的服务器交换?



AFAIK browser page is a "single encoding" unit therefore you cannot
display one paragraph in iso-8859-1 and another in say Shift_JIS. This
is why Unicode became originally needed. Did you try to have the entire
page served in UTF-8 including any further server interchange?


这篇关于原型,Safari和日本问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆