开发者

What encoding setting do I need in MySql to support mathematical symbols?

开发者 https://www.devze.com 2023-02-25 04:22 出处:网络
I need to support the following symbols:π, ∑, ≥, ≠, ≤, ∞, α, Ω, ←, ◊ in a C# application with a mysql back end.

I need to support the following symbols: π, ∑, ≥, ≠, ≤, ∞, α, Ω, ←, ◊ in a C# application with a mysql back end.

开发者_如何学JAVAI have tried setting charset = utf8 (in both the database and connection string), collation = utf8_unicode_cl

and I get "Incorrect string value" errors trying to save.


UPDATE:

I've just installed MySQL Server and HeidiSQL client to my PC, selecting UTF-8 as default server charset.
Also I created a test database and a table as follows:

The database:

CREATE DATABASE `test` /*!40100 CHARACTER SET utf8 COLLATE utf8_general_ci */

The table:

CREATE TABLE `math` (
    `id` INT(10) NOT NULL,
    `symbol` CHAR(1) NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
ROW_FORMAT=DEFAULT

Then I inserted one by one some symbols, copying and pasting them from your post, and from this other page. This is the table after the inserts:

What encoding setting do I need in MySql to support mathematical symbols?

The following is my server configuration:

What encoding setting do I need in MySql to support mathematical symbols?

I hope this information will be actually useful for you


Also, check these links:

  • Unicode:

    Free On-line Unicode Character Map gives you the possibility to see the different characters that are supported (or NOT!) in your browser and see which code is used if you need that. A nice feature with the characters is that you can easily enlarge the text in your browser to see them better. ([Ctrl]+[+] in Mozilla) If you are interested in Math symbols check list "22 Mathematical Operators". For Chemists looking for arrows, list "21" might be interesting.

  • Mathematical UTF-8 Special Characters

  • Unicode 6.0 Character Code Charts
  • Mathematical Symbols in Unicode
  • Collation chart for utf8_general_ci, European alphabets (MySQL 6.0.4): Blocks: Basic Latin, Latin1 Supplement, Latin Extended-A, Latin Extended-B, Latin Extended Additional, Latin ligatures, Greek, Greek Extended, Cyrillic, Cyrillic Supplement, Armenian, Georgian
  • Other MySQL collation charts
0

精彩评论

暂无评论...
验证码 换一张
取 消