如何制作德语网站

发布于 2024-10-30 04:35:03 字数 438 浏览 0 评论 0原文

什么类型的编码或者我必须做什么才能使我的网站正确显示带有德语字符的文本,如下所示: Käse 而不是这样: Käse ?

这是我用于 doctype 的内容:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

这是我用于编码的内容:

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

我使用的 mysql 中的排序规则是 utf8_general_ci,除了英语(从头开始)之外,我从未用其他语言做过网站。我不知道我错过了什么!

谢谢您的宝贵时间!

what type of encoding or what do I have to do to make my web site display properly the text with German characters like this: Käse and not like this: K�se ?

Here is what I use for doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

and here is what I use for encoding:

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

the collation in mysql that I use is utf8_general_ci, I have never done web sites with other languages except for english (from scratch). I dont know what I am missing!

Thank you for your time!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

尝蛊 2024-11-06 04:35:03

您的编码选择看起来不错。

只剩下两个步骤:您必须确保 HTTP 标头中的内容类型也相同,并且您必须确保实际发送的内容是使用 UTF-8 编码的。

Your encoding choise looks fine.

There is just two steps left: You have to make sure that the content type in the HTTP header also says the same, and you have to make sure that what you actually send is encoded using UTF-8.

口干舌燥 2024-11-06 04:35:03

UTF-8 应该用于支持多种语言的网站,因此适合您的需求。

元标记也是正确的,尽管您可能希望确保服务器发送正确的 Content-Type 标题

确保 HTML 文件也使用 UTF-8 编码,而不是 ASCII 或其他代码页。


一般来说,需要确保从DB到浏览器的所有步骤都使用UTF-8(因此,DB列是UTF-8,传输到服务器为UTF-8,渲染为UTF-8,传输到浏览器为UTF-8 具有正确的标头和元标记)。

UTF-8 should used for sites that cater for many languages, so is suitable for your needs.

The meta tag is correct too, though you may want to ensure that the server is sending the right Content-Type header.

Ensure that the HTML file is also encoded with UTF-8 and not ASCII or another codepage.


In general, you need to ensure that all steps from the DB to the browser use UTF-8 (so, DB columns are UTF-8, transferred to the server as UTF-8, rendered as UTF-8, transferred to the browser as UTF-8 with the right headers and meta tags).

╄→承喏 2024-11-06 04:35:03

根据我的经验,要使 utf-8 正常工作:

  1. MySql 数据需要采用某些“utf-8”排序规则
  2. 元标记需要将字符集定义为“utf-8”
  3. MySql 连接器需要设置为“utf” -8”(对于 php,其 mysql_set_charset
  4. )辅助文件(*.php 等)需要以 utf-8 保存(实际上不是必需的,但它可以省去一些麻烦)

From my expiriense, for utf-8 to work right:

  1. MySql data needs to be in some of the "utf-8" collations
  2. The meta tag needs to define charset as "utf-8"
  3. The MySql connector needs to be set to "utf-8" (for php, its mysql_set_charset)
  4. The server-side file (*.php or the like) needs to be saved in utf-8 (not actually necesary, but it saves some pain)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文