在MySQL中使用英语,阿拉伯语和中文

时间:2022-09-10 18:28:22

A few questions regarding character sets:

关于字符集的一些问题:

  1. When storing English, Arabic, and Chinese in a MySQL database, is there any characters set that supports all of these languages?
  2. 在MySQL数据库中存储英语,阿拉伯语和中文时,是否有任何支持所有这些语言的字符集?

  3. Will Chinese and Arabic numbers still store in Integer and decimal type fields?
  4. 中文和阿拉伯数字是否仍会存储在整数和十进制类型字段中?

  5. Are there any other limitations I am not thinking about?
  6. 我还没有考虑其他任何限制吗?

Any guidance is appreciated!

任何指导表示赞赏!

1 个解决方案

#1


2  

you can use UTF to store the text. see http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html

您可以使用UTF来存储文本。请参阅http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html

for numbers, the database stores the actual number, in binary, and not any particular representation of that number. what you need to do is display the numbers in the client program using the correct locale. for php see PHP: Locale aware number format (although i suspect that may only do things like choose the correct symbol for the decimal point, and not change from 0-9 for digits).

对于数字,数据库以二进制形式存储实际数字,而不是该数字的任何特定表示。您需要做的是使用正确的区域设置在客户端程序中显示数字。对于PHP,请参阅PHP:区域设置感知数字格式(尽管我怀疑可能只会选择正确的小数点符号,而不是从0-9更改数字)。

for more background see https://en.wikipedia.org/wiki/Internationalization_and_localization

有关更多背景信息,请参阅https://en.wikipedia.org/wiki/Internationalization_and_localization

#1


2  

you can use UTF to store the text. see http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html

您可以使用UTF来存储文本。请参阅http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html

for numbers, the database stores the actual number, in binary, and not any particular representation of that number. what you need to do is display the numbers in the client program using the correct locale. for php see PHP: Locale aware number format (although i suspect that may only do things like choose the correct symbol for the decimal point, and not change from 0-9 for digits).

对于数字,数据库以二进制形式存储实际数字,而不是该数字的任何特定表示。您需要做的是使用正确的区域设置在客户端程序中显示数字。对于PHP,请参阅PHP:区域设置感知数字格式(尽管我怀疑可能只会选择正确的小数点符号,而不是从0-9更改数字)。

for more background see https://en.wikipedia.org/wiki/Internationalization_and_localization

有关更多背景信息,请参阅https://en.wikipedia.org/wiki/Internationalization_and_localization