How to store Euro Symbol in mysql database?

前端 未结 4 448
灰色年华
灰色年华 2020-12-18 01:03

How to store symbol for Euro currency in MySQL Database ?

4条回答
  •  感情败类
    2020-12-18 01:23

    While I also recommend UTF-8, I wanted to add some clarification of why you may be having trouble storing the Euro symbol in other encodings.

    The Euro symbol was added as a patch to existing Windows and Mac legacy encodings circa 1997. In Windows-1252, the Windows latin-1 character set, the codepoint chosen was 0x80, and MacRoman chose a different location. That's all fine, but many applications specify iso-8859-1 encoding in their MySql database Schema for Latin 1-General text, or mark their HTML output in web applications with iso-8859-1. Iso-8859-1 was never, to my knowledge, officially updated to map a codepoint for the Euro symbol. The latin1 encoding that does support the Euro is the infrequently used iso-8859-15.

    So, if you are using iso-8859-1 encodings in your schema, you will have undefined, or worse, behavior.

提交回复
热议问题