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

RE: UTF8_STRING patch

Expand Messages
  • Maiorana, Jason
    ... one quick question: how do you determine which is the appropriate encoding to pass to clip_yank_selection . It looks like the GDK functions all assume
    Message 1 of 6 , Aug 9, 2002
    • 0 Attachment
      >For the conversion, look in mbyte.c. The functions convert_setup() and
      >string_convert() should be able to do it.

      one quick question: how do you determine which is the appropriate
      encoding to pass to "clip_yank_selection".

      It looks like the GDK functions all assume that the data is in the
      format
      of the current locale: this is incorrect i think. I set encoding=utf8
      which does not match my en_US locale. I dont have really working locales
      for utf8, if there was an "allLangs_USkbd.utf8" locale i would use it.

      Converting COMPOUND_TEXT to my current locale would only corrupt it,
      which probably explains why that never worked for me. Doesnt vim
      have some notion of internal representation encoding? If vim were
      to always use utf-8 internally in all situations, that would make
      UTF8_STRING conversion a non-issue...
    • Bram Moolenaar
      ... I dunno. You could try looking in the GTK documentation (but you probably end up looking in the source code...). ... The value of encoding defines the
      Message 2 of 6 , Aug 10, 2002
      • 0 Attachment
        Jason Maiorana wrote:

        > >For the conversion, look in mbyte.c. The functions convert_setup() and
        > >string_convert() should be able to do it.
        >
        > one quick question: how do you determine which is the appropriate
        > encoding to pass to "clip_yank_selection".
        >
        > It looks like the GDK functions all assume that the data is in the
        > format of the current locale: this is incorrect i think. I set
        > encoding=utf8 which does not match my en_US locale. I dont have
        > really working locales for utf8, if there was an "allLangs_USkbd.utf8"
        > locale i would use it.

        I dunno. You could try looking in the GTK documentation (but you
        probably end up looking in the source code...).

        > Converting COMPOUND_TEXT to my current locale would only corrupt it,
        > which probably explains why that never worked for me. Doesnt vim
        > have some notion of internal representation encoding? If vim were
        > to always use utf-8 internally in all situations, that would make
        > UTF8_STRING conversion a non-issue...

        The value of 'encoding' defines the encoding used internally in Vim for
        all text in buffers, registers, etc.

        --
        "Hit any key to continue" it said, but nothing happened after F sharp.

        /// 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 ///
        \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
      • Maiorana, Jason
        ... Its says in their doc s that gdk_text_property_to_text_list converts from compound text the process s current locale. Vim however needs the text to be
        Message 3 of 6 , Aug 12, 2002
        • 0 Attachment
          > > It looks like the GDK functions all assume that the data is in the
          > > format of the current locale: this is incorrect i think.

          >I dunno. You could try looking in the GTK documentation (but you
          >probably end up looking in the source code...).

          Its says in their doc's that "gdk_text_property_to_text_list" converts
          from "compound text" the process's current locale. Vim however needs
          the text to be in option["encoding"] encoding, regardless of the
          current locale. So I think that pasting compound text through gtk
          into a vim where buffer encoding doesnt match locale LC_CTYPE wont work.
          Mostly this is irrelevant because COMPOUND_TEXT is thoroughly deprecated
          imo.

          >> Converting COMPOUND_TEXT to my current locale would only corrupt it,
          >> which probably explains why that never worked for me. Doesnt vim
          >> have some notion of internal representation encoding? If vim were
          >> to always use utf-8 internally in all situations, that would make
          >> UTF8_STRING conversion a non-issue...

          >The value of 'encoding' defines the encoding used internally in Vim for
          >all text in buffers, registers, etc.

          I will look into calling "get_option_value" for the purpose of passing
          to
          "convert_setup".
        • Glenn Maynard
          ... Just pass p_enc. -- Glenn Maynard
          Message 4 of 6 , Aug 12, 2002
          • 0 Attachment
            On Mon, Aug 12, 2002 at 03:41:55PM -0400, Maiorana, Jason wrote:
            > >The value of 'encoding' defines the encoding used internally in Vim for
            > >all text in buffers, registers, etc.
            >
            > I will look into calling "get_option_value" for the purpose of passing
            > to
            > "convert_setup".

            Just pass p_enc.

            --
            Glenn Maynard
          Your message has been successfully submitted and would be delivered to recipients shortly.