Created
February 11, 2016 22:30
-
-
Save uchidev/ce8d9afc8b2b6317839b to your computer and use it in GitHub Desktop.
UTF-8/UTF-16
This file contains hidden or 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
| (apply 'concat '("a" "b")) | |
| ;; "ab" | |
| (mapconcat #'(lambda (x) x) '("a" "b") "") | |
| ;; "ab" | |
| (mapconcat #'(lambda (x) (char-to-string x)) "ab" "") | |
| ;; "ab" | |
| (mapconcat #'(lambda (x) (char-to-string x)) '(?a ?b) "") | |
| ;; "ab" | |
| '(?a ?b) | |
| ;; (97 98) | |
| (mapconcat #'(lambda (x) (format "%02x" x)) "abc" "_") | |
| ;; "61_62_63" | |
| (mapconcat #'(lambda (x) (format "%X" x)) "あいう" "_") | |
| ;; "3042_3044_3046" | |
| (mapconcat #'(lambda (x) (format "%X" x)) (encode-coding-string "あいう" 'utf-8) "_") | |
| ;; "E3_81_82_E3_81_84_E3_81_86" | |
| (mapconcat #'(lambda (x) (format "%X" x)) (encode-coding-string "あいう" 'utf-16be) "_") | |
| ;; "30_42_30_44_30_46" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment