Loading ...
Sorry, an error occurred while loading the content.

Re: convert_setup

Expand Messages
  • Bram Moolenaar
    ... Vim internally uses UTF-8 for all unicode encodings, also for UCS-2. convert_setup() isn t a fully generic function, it s only for its specific use in Vim.
    Message 1 of 2 , Jul 13, 2002
      Glenn Maynard wrote:

      > I'm fixing up the clipboard patch, and I'm hitting some problems with
      > convert_setup; it forces to and from to utf-8 for all encodings. What
      > needs this? I think it'd be cleaner to do this at the caller, where
      > needed.

      Vim internally uses UTF-8 for all unicode encodings, also for UCS-2.
      convert_setup() isn't a fully generic function, it's only for its
      specific use in Vim.

      > I need to be able to convert from penc to UCS-2 and back. I have it
      > working, but it'd be cleaner as part of string_convert.

      I think conversion from/to UCS-2 should be separate, because Vim doesn't
      use UCS-2 itself. If you do use UCS-2 in your system specific code,
      I'm not sure if changing a generic function for this is such a good

      > You mentioned the reason iconv is optional is because of its size. I
      > wonder if there's an easy way to strip down iconv to only include
      > Unicode conversions and ISO-8859 tables, to a size that's reasonable to
      > package with Vim? I'll take a look, if you're interested. Being able
      > to depend on iconv for basic Unicode conversions (UCS2<->UCS4<->UTF8)
      > would be nice.

      I think this causes more confusion than it solves. It's very difficult
      to make a choice for which encodings to drop. People are going to ask
      for their encoding, until we have included all of them again.

      We don't need iconv for conversion between Unicode and Latin1, It's
      builtin. Just supporting ISO-8859 encodings in the same way could be
      done without iconv, it's not very difficult. But keep in mind that
      MS-Windows codepages are not ISO-8859 encodings, even though they come

      FIRST SOLDIER: So they wouldn't be able to bring a coconut back anyway.
      SECOND SOLDIER: Wait a minute! Suppose two swallows carried it together?
      FIRST SOLDIER: No, they'd have to have it on a line.
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
      \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
    Your message has been successfully submitted and would be delivered to recipients shortly.