On 3/30/14, Dmitry Frank <[email protected]> wrote:
> 2014-03-30 20:04 GMT+04:00 Yasuhiro MATSUMOTO <[email protected]>:
>
>> > This is not good. These inconsistencies need to be fixed.
>> No, don't break compatibility.
>> vim script should handle bytes as index.
>>
>>
> We already have mentioned, and not once, that nobody wants to break
> compatibility, but we want to have full support of character (aka "unicode
> codepoint") support.
>
> As Andre Sihera wrote: "So far we have all byte support and little-to-no
> character support".
>
> In my opinion, it's good to add functions mbmatch(), mbstrpart(),
> mbstridx(), etc. Compatibility will be kept then.
Let's not forget that this can be outsourced to Python (and probably
other languages that Vim scripting supports):
python << EOF
import vim
# get Vim internal encoding
ENC = vim.eval('&enc')
if ENC in ('utf-8','ucs-2','ucs-2le','utf-16','utf-16le','ucs-4','ucs-4le'):
ENC = 'utf-8'
# convert current buffer line to Unicode object
curline = vim.current.line
print type(curline)
curline = curline.decode(ENC)
print type(curline)
# work with characters
print len(curline)
print curline.upper()
print curline[2:]
EOF
Regards,
Vlad
--
--
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
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.