How to store Euro Symbol in mysql database?

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

How to store symbol for Euro currency in MySQL Database ?

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-18 01:14

    Create a column with a character set that supports the Euro character.

    CREATE TABLE MyTable
    (
        MyEuroColumn VARCHAR(5)
          CHARACTER SET utf8
          COLLATE utf8_general_ci 
    );
    

    If your editor doesn't support Unicde, you can insert it like;

    select concat('Five ', _ucs2 0x20AC, ' please!')
    

    You can also store the Euro symbol in other character sets:

    UTF-8                  0xE282AC
    UCS-16                 0x20AC
    ISO-8859-15 (latin-9)  0xA4
    

提交回复
热议问题