Skip to content

Instantly share code, notes, and snippets.

@TonnyXu
Created December 26, 2011 06:08
Show Gist options
  • Save TonnyXu/1520607 to your computer and use it in GitHub Desktop.
Save TonnyXu/1520607 to your computer and use it in GitHub Desktop.
generate Unicode characters as you want
function! GenerateUnicode(first, last)
let i = a:first
while i <= a:last
" you can change the format, here \'%04X\' => \' is used to output the value and make it avaiable for php.
let c = printf("\'%04X\' => \'", i)
for j in range(16)
let c = c . nr2char(i)
let i += 1
endfor
" also, append \', to the end of line, to make it php compatable.
let d = printf("\'%s", ",")
let c = c . d
$put = c
endwhile
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment