-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path03-demo-charset-01-show.sql
executable file
·38 lines (38 loc) · 1.43 KB
/
03-demo-charset-01-show.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* Version: 0.1.0 */
/* source 03-demo-charset-01-show.sql */
/* English Characters */
SELECT length('Hello') as Byte_Length,
char_length('Hello') as Char_Length,
'Hello' as English,
cast('Hello' as CHAR character set gbk) as GBK_ENCODED,
cast('Hello' as CHAR character set utf8mb4) as UTF8MB4_ENCODED,
cast(
cast('Hello' as CHAR character set gbk) as binary
) as GBK_BINARY,
cast(
cast('Hello' as CHAR character set utf8mb4) as binary
) as UTF8MB4_BINARY;
/* Japanese Characters */
SELECT length('こんにちは') as Byte_Length,
char_length('こんにちは') as Char_Length,
'こんにちは' as Japanese,
cast('こんにちは' as CHAR character set gbk) as GBK_ENCODED,
cast('こんにちは' as CHAR character set utf8mb4) as UTF8MB4_ENCODED,
cast(
cast('こんにちは' as CHAR character set gbk) as binary
) as GBK_BINARY,
cast(
cast('こんにちは' as CHAR character set utf8mb4) as binary
) as UTF8MB4_BINARY;
/* Chinese Characters */
SELECT length('你好') as Byte_Length,
char_length('你好') as Char_Length,
'你好' as Chinese,
cast('你好' as CHAR character set gbk) as GBK_ENCODED,
cast('你好' as CHAR character set utf8mb4) as UTF8MB4_ENCODED,
cast(
cast('你好' as CHAR character set gbk) as binary
) as GBK_BINARY,
cast(
cast('你好' as CHAR character set utf8mb4) as binary
) as UTF8MB4_BINARY;