UTF-8编码解码不使用丹麦字符 [英] UTF-8 encoding decoding not working with Danish characters
问题描述
大家好,
我是XML的新手,但我用它作为RSS提要。
我有一个问题,我真的有一直在努力。
我的XML文档是从MySQL数据库的内容生成的。这是
UTF-8编码。
然而,丹麦特殊字符显示错误。
例如这封信?变成?¥,这封信?变成??
参见此处的考试:
http://netm.dk/blog/rss/index_rss2.xml
我认为可能是因为编码没有在文件中设置,
所以我添加了这个:
<?xml version =" 1.0"编码= QUOT; UTF-8英寸?>
但是,这没有任何区别,如下所示:
http://netm.dk/blog/rss/test_rss2.xml
文本在我的常规文本中正确解码 http://netm.dk/ 上的网页
我做错了什么?
问候,
Lars
www.netm.dk
LarsM写道:大家好,
我是XML的新手,但我用它作为RSS提要。
我有一个问题,我真的是苦苦挣扎。
我的XML文档是从MySQL数据库的内容生成的。它是UTF-8编码的。
然而,丹麦的特殊字符出现了错误。
例如这封信?变成?¥,这封信?变成??
在这里查看一个例子:
http://netm.dk/blog/rss/index_rss2.xml
我认为可能是因为编码未在文档中设置,
所以我添加了这个:
<?xml version =" 1.0"编码= QUOT; UTF-8英寸?>
然而,这没有任何区别,如下所示:
http://netm.dk/blog/rss/test_rss2.xml
文本在我的常规网页上正确解码 http://netm.dk/
我做错了什么?
问候,
Lars
www.netm.dk
这不仅限于XML。我尝试发送JavaMail邮件。当从Windows PC上执行这个
时,丹麦字符会出现乱码,当在Linux上运行完全相同的程序时,字符会很好。
希望我们在生命中的某个时间摆脱%%£%£d d N N N N $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $LarsM写道:
我的XML文档是从MySQL数据库的内容生成的。它是UTF-8编码的。
您必须注意*工具链中的每个*工具
知道如何正确处理utf-8。也许你给我们
a涉及的工具列表?
文本在我的常规网页上正确解码 http://netm.dk/
你的网页看起来还不错。
我打赌它在数据库中或之后不久。
"JürgenKahrs"写道:
也许你给我们一个工具清单?
谢谢Jürgen,
RSS提要由同一个博客应用程序
(Boastmachine)生成,我用它来生成网页。据我所知,
以与真实相同的方式访问数据库。页面。
但是我会检查一下。
-Lars
Hi all,
I am new to XML, but I use it for an RSS feed.
I have one problem, which I have really been struggling with.
My XML document is generated from the contents of a MySQL database. It is
UTF-8 encoded.
However, the Danish special characters appear wrong.
For example the letter ? becomes "?¥", the letter ? becomes "??"
See an examle here:
http://netm.dk/blog/rss/index_rss2.xml
I thought that it could be because the encoding was not set in the document,
so I added this:
<?xml version="1.0" encoding="UTF-8" ?>
However, that did not make any difference, as can be seen here:
http://netm.dk/blog/rss/test_rss2.xml
The text decodes correctly on my regular web pages on http://netm.dk/
What am I doing wrong?
Regards,
Lars
www.netm.dk
解决方案LarsM wrote:Hi all,
I am new to XML, but I use it for an RSS feed.
I have one problem, which I have really been struggling with.
My XML document is generated from the contents of a MySQL database. It is
UTF-8 encoded.
However, the Danish special characters appear wrong.
For example the letter ? becomes "?¥", the letter ? becomes "??"
See an examle here:
http://netm.dk/blog/rss/index_rss2.xml
I thought that it could be because the encoding was not set in the document,
so I added this:
<?xml version="1.0" encoding="UTF-8" ?>
However, that did not make any difference, as can be seen here:
http://netm.dk/blog/rss/test_rss2.xml
The text decodes correctly on my regular web pages on http://netm.dk/
What am I doing wrong?
Regards,
Lars
www.netm.dk
This is not limited to XML. I try to send JavaMail mails. When doing
this from a Windows PC, Danish characters are garbled, when running the
exact same program on Linux, the characters get through fine.
Hope we get rid of thos ¤%@£¥ darned NLS issues sometime in my lifetime,
but I doubt it.
LarsM wrote:
My XML document is generated from the contents of a MySQL database. It is
UTF-8 encoded.
You have to take care that *every* tool in the toolchain
knows how to handle utf-8 correctly. Maybe you give us
a list of tools involved ?
The text decodes correctly on my regular web pages on http://netm.dk/
Your web page looks OK to me.
I bet it is in the database or shortly thereafter.
"Jürgen Kahrs" wrote:
Maybe you give us a list of tools involved ?
Thanks Jürgen,
The RSS feed is being generated by the same Blog application
("Boastmachine"), which I use to generate the Web pages. As far as I know it
accesses the database in the same way as for the "real" pages.
But I will check up on that.
-Lars
这篇关于UTF-8编码解码不使用丹麦字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!