丹麦字符替换为问号 [英] Danish characters replaced by question mark
本文介绍了丹麦字符替换为问号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要从这个丹麦语字符串中删除问号。
I want to remove the question marks from this string which is in Danish.
...mest i betydningen moralsk ford�rvelse eller bestikkelighed, men ogs� i...
我尝试了 utf8_encode ()
,它返回以下内容:
I tried utf8_encode()
which return the following:
...mest i betydningen moralsk ford�rvelse eller bestikkelighed, men ogs� i...
第一个字符串是我在XML中获得的响应Web服务。
The first string is the response I get in a XML in a web service. Is there a way to fix this from my side?
推荐答案
您可以使用
header('Content-type: text/html; charset=utf-8');
在您的页面中将字符编码设置为UTF-8。
to set the character encoding to UTF-8 in your page.
除了确保您告诉浏览器您使用的是UTF-8之外,请将其添加到您的代码中:
As well as making sure that you tell the browser you are using UTF-8, add this to your code:
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<!-- rest of code here -->
</head>
还要记住,它也取决于这些数据来自何时。如果数据库已关闭,请检查数据库的编码。
Also remember that it also depends on when this data is coming from. Check the encoding of the database if it's pulled off a database.
这篇关于丹麦字符替换为问号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文