Skip to content

Instantly share code, notes, and snippets.

@MarcelineVQ
Last active August 25, 2020 20:29
Show Gist options
  • Save MarcelineVQ/c48fd0286d3aa749d9dc4843307bb5a3 to your computer and use it in GitHub Desktop.
Save MarcelineVQ/c48fd0286d3aa749d9dc4843307bb5a3 to your computer and use it in GitHub Desktop.
%foreign "C:worf,libutf8"
worf : Char -> Char
%foreign "C:worf2,libutf8"
worf2 : Int -> Int
main : IO ()
main = do
putCharLn 'πŸ˜€'
putCharLn (worf 'a')
putCharLn (chr (worf2 (ord 'πŸ˜€')))
putCharLn (worf 'πŸ˜€')
char worf(char c) { return c; }
int worf2(int c) { return c; }
// cc utf.c -shared -o libutf8.so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment