[MDEV-17088] Provide tools to encode/decode mysql-encoded file system names Created: 2018-08-29 Updated: 2020-02-27 Resolved: 2019-12-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Character Sets |
| Fix Version/s: | 10.5.1 |
| Type: | Task | Priority: | Minor |
| Reporter: | Hartmut Holzgraefe | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | beginner-friendly | ||
| Issue Links: |
|
||||||||||||
| Description |
|
As non-ASCII letters are encoded in database directory names and table file nasenames there should be tools that can be used to perform conversion to human-readable unicode output (and back from unicode to encoded form?), either as SQL function, command line tool, or both. e.g. @6e2c@8a66@8cc7@6599@5eab' <-> 測試資料 See also:
and especially the comment from HeidiSQL on the later one. |
| Comments |
| Comment by Marko Mäkelä [ 2018-08-29 ] | ||||
|
I believe that this is a documentation issue, not a code bug. The CONVERT function with the filename character set should already do the trick:
It will return the conversion:
Note: these strings are from the description. The hexadecimal string had 5 encoded 5-byte characters, while the UTF-8 string only has 4 characters corresponding to the 4 first 5-byte characters. | ||||
| Comment by Hartmut Holzgraefe [ 2018-08-29 ] | ||||
|
Ok, that covers the SQL level part, but I still think we should have some binary tool, maybe a "myls", to be able to do the conversion on the command line without having to fall back to mysql -e 'SELECT CONVERT ...' Shouldn't be too hard to create a simple wrapper binary around the strconvert() function? | ||||
| Comment by Sergei Golubchik [ 2018-08-29 ] | ||||
|
I've documented the filename charset in https://mariadb.com/kb/en/library/identifier-to-file-name-mapping/ Let's keep this issue open until a tool is created. But it should be a Task, not a Bug. | ||||
| Comment by Takashi Sasaki [ 2018-10-14 ] | ||||
|
Is it a simple wrapper command that calls an existing function? example: |