Re: handy Unicode/UTF-8 reference

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: handy Unicode/UTF-8 reference

A.J.Mechelynck
Tim Chase wrote:

> Tony,
>
> As you're usually the one to provide very detailed responses on the Vim
> list, I thought you might like to add this link
>
> http://eyegene.ophthy.med.umich.edu/unicode/
>
> to your bookmark list as a nice intro to doing Unicody stuff. Stumbled
> across it today and thought it might pique your interest.  It also might
> save your the trouble of redescribing Unicoding for each of your
> responses :)  (unless you already have a nice little template doc typed
> up and just copy & paste each time ;-)
>
> -tim

Thanks. It is indeed interesting, even though it is "for Unix/Linux" and
I'm on Windows. I just downloaded a "pan-Unicode" font linked from it
(Bitstream Cyberbit). It is fatter and not as elegant as some "less
generalistic" fonts like Times New Roman (Latin), Traditional Arabic
(Arabic) and MingLiU (Traditional Chinese).

And no, I don't have a Unicode boilerplate text yet. (Maybe I should) ;-)

Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: handy Unicode/UTF-8 reference

Steve Hall-4
From: "A. J. Mechelynck", Oct 13, 2005 2:17 PM
> Tim Chase wrote:
> >
[snip]
> >
> > http://eyegene.ophthy.med.umich.edu/unicode/
> >
> > It also might save your the trouble of redescribing Unicoding for
> > each of your responses :)
[snip]
>
> And no, I don't have a Unicode boilerplate text yet. (Maybe I
> should) ;-)

Here's an interesting bit you can add, I wrote a function that neatly
prints unicode characters (the first 65,375) just this week:

  function! PrintUnicode()

      let myenc = &encoding
      set encoding=utf8

      " limitations
      let min = 32
      let max = 65375
      let str = ""
      let numlen = strlen(Nr2Hex(max))
      let num = ""
      let wid = 37

      let i = 0
      while min+i < max
          if i % (wid - strlen(max)) == 0
              echo str
              let num = min+i
              " convert to hex
              let num = Nr2Hex(num)
              " pad
              while strlen(num) < numlen
                  let num = " " . num
              endwhile
              let str = num . ": "
          endif
          let str = str . nr2char(min+i)
          let i = i + 1
      endwhile
      " print remainder
      echo str

      let &encoding = myenc

  endfunction

See :help eval-examples for an example of dependancy Nr2Hex().

--
Steve Hall  [ digitect mindspring com ]



Reply | Threaded
Open this post in threaded view
|

Re: handy Unicode/UTF-8 reference

A.J.Mechelynck
Steve Hall wrote:
[...]
> Here's an interesting bit you can add, I wrote a function that neatly
> prints unicode characters (the first 65,375) just this week:
[...]

Interesting function; but since my concern is usually translating a
glyph (shape) to a codepoint number, not vice-versa, I usually rely on
the code charts at http://www.unicode.org/charts/index.html and
http://www.unicode.org/charts/symbols.html

Best regards,
Tony.