多语言站点

编程入门 行业动态 更新时间:2024-10-09 12:25:42
本文介绍了多语言站点-英语,日语,韩语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

开发一个支持2字节语言(日语,中文)的网站难吗?我正计划使用PHP开发一个多语言站点.如果您知道一些简单的方法,请告诉我.

Is it that difficult to develop a site that supports 2 byte languages (Japanese, Chinese)? I am planning to develop a multilingual site using PHP. Kindly let me know, if you know some easy methods.

推荐答案

双字节"字符集已经成为过去(*).今天,您使用Unicode字符集,这样站点就可以无缝地支持每种语言,而不必担心切换代码页的麻烦.

‘Double-byte’ character sets are pretty much(*) a thing of the past. Today, you use the Unicode character set so a site can support every language seamlessly without the horror of switching code pages.

编写以UTF-8编码保存的页面内容,将其保存给浏览器作为UTF-8,并设置您的数据库表和数据库连接到UTF-8.本身通常就足够了.如果您需要能够处理UTF-8字符串而不会意外地将字符截成两半,请使用 mbstring .

Write your page content saved in the UTF-8 encoding, serve it to browsers as UTF-8 and set your database tables and database connection to UTF-8. That's often enough in itself. If you need to be able to process UTF-8 strings without accidentally snipping a character in half, use mbstring.

(*:东亚仍然有一些可怕的旧系统需要编码为讨厌的旧字符集,例如旧手机和一些狡猾的网络邮件服务.希望这不会对您造成影响.情况下,您仍应在内部使用UTF-8进行所有操作,但在出局时使用 iconv 转换为例如Shift-JIS.)

(*: there are still a few horrible old systems in East Asia that you have to encode to nasty legacy character sets for, such as old mobile phones and some dodgy webmail services. Hopefully this won't affect you. In this case you should still use UTF-8 internally for everything, but use iconv to convert to eg. Shift-JIS on the way out.)

更多推荐

多语言站点

本文发布于:2023-11-02 07:11:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551711.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多语言   站点

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!