Bug #94761 | "Upper ascii" or high-bit characters not mapping correctly in Terminal on Mac OS | ||
---|---|---|---|
Submitted: | 24 Mar 2019 21:06 | Modified: | 26 Mar 2019 11:52 |
Reporter: | Karen x | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S3 (Non-critical) |
Version: | MySQL Community Server 8.0.15, 8.0.15 | OS: | MacOS (High Sierra 10.13.6) |
Assigned to: | CPU Architecture: | Any | |
Tags: | Mac OS, Special Characters, terminal |
[24 Mar 2019 21:06]
Karen x
[25 Mar 2019 0:47]
Karen x
I also tried the following script: set names macroman; set @erom="é", @chr233rom=char(233); select "macroman", @erom, hex(@erom), @chr233rom, hex(@chr233rom)\G And received this response: *************************** 1. row *************************** macroman: macroman @erom: é hex(@erom): C3A9 @chr233rom: ? hex(@chr233rom): E9 1 row in set (0.00 sec)
[26 Mar 2019 11:52]
MySQL Verification Team
Hello Karen, Thank you for the report and test case. Verified as described on Mac OS X 10.14.3. thanks, Umesh
[3 Apr 2019 14:02]
Erlend Dahl
Posted by developer: Comments from Bernt: mysql> select char(200); +-----------+ | char(200) | +-----------+ | � | +-----------+ 1 row in set (0.00 sec) According to the docs: CHAR() interprets each argument N as an integer and returns a string consisting of the characters given by the code values of those integers. mysql> select hex(char(200)); +----------------+ | hex(char(200)) | +----------------+ | C8 | +----------------+ 1 row in set (0.00 sec) C8 is not a legal single byte in UTF-8. But in order to display codepoint U+00C8 we can do mysql> select char(50056); +-------------+ | char(50056) | +-------------+ | È | +-------------+ Because the docs say CHAR() arguments larger than 255 are converted into multiple result bytes. For example, CHAR(256) is equivalent to CHAR(1,0), and CHAR(256*256) is equivalent to CHAR(1,0,0): And 50056 becomes C388 which is UTF-8 of U+00C8 ......