Created
March 10, 2014 05:36
-
-
Save noborus/9460008 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT '0x' || | |
encode(substr(s.word::text,generate_series(1,length(s.word::text),1),1)::bytea, 'hex') AS code, | |
substr(s.word::text,generate_series(1,length(s.word::text),1),1) AS char | |
FROM | |
(SELECT '漢字' AS word) AS s; | |
code | char | |
----------+------ | |
0xe6bca2 | 漢 | |
0xe5ad97 | 字 | |
(2 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SELECT '0x'||encode(char::bytea, 'hex') AS code, char
FROM
(SELECT regexp_split_to_table('漢字', '') AS char) AS w;
こっちのが短かい。