Phil Carter wrote: > Using ctrl+v U in insert mode, you can enter Unicode characters by > code point. UTF-8 can only encode up to U+7FFFFFFF. Entering any code > point up to that value works fine, but if if you type "ctrl+v U > 81234567" for example, you get "<t_" followed by some other bytes > instead of the requested code point. > > I don't know where to submit bug fixes but since this one is only two > lines long, I'll post it here. In edit.c you can replace this line: > > if ((unicode == 'u' && i >= 4) || (unicode == 'U' && i >= 8)) > > with this: > > if ((unicode == 'u' && i >= 4) || > (unicode == 'U' && (i == 7 && cc > 0x7FFFFFF || i >= 8))) > > This way vim stops reading input after 7 hex digits if an eighth digit > would make the code point higher than what UTF-8 can encode.
I have been wondering if we should restrict the Unicode characters to 10FFFF. This is the official limit that was set a couple of years ago. There won't be valid characters above this limit, so why allow inserting them? -- ZOOT: I'm afraid our life must seem very dull and quiet compared to yours. We are but eightscore young blondes, all between sixteen and nineteen-and-a-half, cut off in this castle, with no one to protect us. Oooh. It is a lonely life ... bathing ... dressing ... undressing ... making exciting underwear.... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php