Skip to content

Instantly share code, notes, and snippets.

@coke

coke/weird.md Secret

Last active January 10, 2017 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coke/6b627a81301d0b741af297a7740e631b to your computer and use it in GitHub Desktop.
Save coke/6b627a81301d0b741af297a7740e631b to your computer and use it in GitHub Desktop.

trying to debug a unicode problem. I am trying to interact with

http://www.fileformat.info/info/unicode/char/0500/index.htm

if I use

perl6 -e'chr(0x32).print' | od -h

I get 0032 out. if I use 0x500, I instead get 80d4 as output. If I remove the pipe to od, it looks ok, but if I cut and paste into

perl6 -e '"<the char>".uninames.say'

I get

(<Plane 16 Private Use> LATIN SMALL LETTER X LATIN CAPITAL LETTER D DIGIT FOUR <Plane 16 Private Use> LATIN SMALL LETTER X DIGIT EIGHT DIGIT ZERO)

but

perl6 -e 'chr(0x500).uninames.say'

gives the expected

(CYRILLIC CAPITAL LETTER KOMI DE)

something about emitting it and cutting and pasting it is screwy. Any pointers?

FYI, happens with iTerm2 or Terminal on my osx box (10.12.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment