Last active
December 16, 2015 01:58
-
-
Save kawasima/11162616 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
(defn to-hex-str [bs] | |
(let [sb (StringBuilder. 8)] | |
(doseq [b bs] | |
(.append sb (Integer/toHexString (bit-and (bit-shift-right b 4) 0xF))) | |
(.append sb (Integer/toHexString (bit-and b 0xF)))) | |
(.toString sb))) | |
(doseq [i (range 32 65536)] | |
(let [ch (String. (into-array Integer/TYPE [i]) 0 1) | |
ch-ms932 (vec (.getBytes ch "ms932")) | |
ch-cp943c (vec (.getBytes ch "cp943c"))] | |
(if (not= ch-ms932 ch-cp943c) | |
(println ch (format "%x" i) (to-hex-str ch-ms932) (to-hex-str ch-cp943c))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment