Morton Fox (mortonfox) wrote,
Morton Fox
mortonfox

age++

Pine Creek

I'm 35!

On a day like yesterday, well, let's just say that I'm glad my investment portfolio is very unconventional. While the S&P 500 slid 4.7%, my trading account was up 7.7%. So thanks, Wall Street, for the early birthday present. :)

This evening, I did some work on Unicode and Multibyte support in TwitVim because a user asked for it. That took some experimentation because Vim script handles Unicode in a somewhat inconsistent manner. Some common string functions like strlen(), strpart(), etc, and string[] indexing deal in bytes, not characters, so to get the actual length in characters of a Unicode string, for example, you need a weird hack like strlen(substitute(unicode_str, ".", "x", "g")). That code snippet, which I came across in Vim's help documentation, replaces each character, multibyte or not, in the string with a single ASCII character before calculating the string length the naive way.

I'm still unsure whether my code handles some of Vim's more obscure character encodings correctly, so I hope a user will let me know if it breaks somewhere.

Anyway, I have some things to do and places to go tomorrow so I'd better get some sleep. Later!
Tags: birthday, multibyte, twitvim, unicode
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 43 comments
Previous
← Ctrl ← Alt
Next
Ctrl → Alt →
Previous
← Ctrl ← Alt
Next
Ctrl → Alt →