I think I found a solution.

But first the problem, which preferably would be fixed in the Pharo VM but
I have no idea how to contribute there or if this is actually correct/wrong:
After a lot of debugging and trying to figure out why paste from Google
Chrome(ium) isn't working in Linux I found out that the default encoding
isn't unicode.

According to this the default should be UTF-8
platforms/unix/vm/sqUnixMain.c:1493  printf("  --textenc <enc>        set
encoding for external text (default: UTF-8)\n");

however by default it is set to 0
platforms/unix/vm/sqUnixMain.c:127        int    textEncodingUTF8= 0;    /*
1 if copy from external selection uses UTF8 */

and only set to 1 if it is explicitly provided (--textenc UTF-8)
platforms/unix/vm/sqUnixMain.c:1452     else if (!strcmp(argv[0],
"--textenc"))
    {
      char *buf= (char *)malloc(strlen(argv[1]) + 1);
      int len, i;
      strcpy(buf, argv[1]);
      len= strlen(buf);
      for (i= 0;  i < len;  ++i)
        buf[i]= toupper(buf[i]);
      if ((!strcmp(buf, "UTF8")) || (!strcmp(buf, "UTF-8")))
        textEncodingUTF8= 1;
      else
        setEncoding(&uxTextEncoding, buf);
      free(buf);
      return 2;
    }

--

So the (temporary) fix is quite simple: specify the --textenc encoding when
launching Pharo. :)

Peter


On Thu, Jul 31, 2014 at 12:38 PM, Julien Delplanque <[email protected]>
wrote:

> Ok, so I'll have to get used to it or switch to another web browser
> while using pharo.
>
> Thanks for your answers.
>
> On 31/07/14 10:44, Peter Uhnák wrote:
> > It seems that the Chromium issue is most likely a result of them
> switching
> > from GTK to Aura, since it broke in version 35 (when Aura was
> introduced).
> > So unless someone wants to dive into Pharo VM or Chromium then there is
> > really no simple solution.
> >
> >
> > On Wed, Jul 30, 2014 at 9:10 PM, Peter Uhnák <[email protected]> wrote:
> >
> >> Today I found out that if I have running xclipboard in the background
> >> pasting works properly even from Chromium. The problem is that it's a
> GUI
> >> app and will store everything that I've copied unless manually deleted.
> But
> >> you can give it a shot. Haven't really tested how it deals with non-text
> >> content (images).
> >> Also I tried to dig a little bit into how it is handled inside Pharo,
> but
> >> it is somewhere deep in VM. :(
> >> However middle-click pasting doesn't work but that seem to be simply a
> >> limitation of Pharo (My guess is because it is only supported by Linux
> and
> >> not Windows/Mac?).
> >>
> >>
> >> On Tue, Jul 29, 2014 at 9:42 PM, Julien Delplanque <[email protected]>
> >> wrote:
> >>
> >>> I also notice the problem when I copy something from my terminal
> >>> ("drop-down terminal" or "terminator" on Gnome3) to pharo IDE.
> >>>
> >>> Very annoying to copy text from Chromium to Sublime text and then
> recopy
> >>> it from Sublime text to Pharo IDE even if (sadly) it became a habit...
> >>>
> >>> On 29/07/14 20:10, Peter Uhnák wrote:
> >>>> I have the same problem on Debian, on both Pharo 3 and 4.
> >>>> I think that Chromium is doing something weird when copying to
> >>> clipboard,
> >>>> because every other program I've tried works just fine.
> >>>> As a workaround I've installed clipboard manager and I copy from there
> >>> (or
> >>>> paste and re-copy in some other text editor currently opened).
> >>>>
> >>>> Linux has multiple clipboards (at least one when copying text and one
> >>> for
> >>>> currently selected text), so maybe Chromium uses the wrong one, or
> >>> Pharo is
> >>>> checking only one?
> >>>>
> >>>> Peter
> >>>>
> >>>>
> >>>> On Tue, Jul 29, 2014 at 5:06 PM, Julien Delplanque <[email protected]>
> >>> wrote:
> >>>>> Hello,
> >>>>>
> >>>>> I'm using pharo 3.9-7 and I notice that sometimes the copy/past
> >>> function
> >>>>> from another program to the pharo IDE doesn't work.
> >>>>>
> >>>>> For example, if I copy something from my internet browser (Chromium)
> to
> >>>>> a workspace in the IDE it doesn't work.
> >>>>>
> >>>>> I also notice that if I copy something from my text editor (Sublime
> >>>>> text) to a workspace it works...
> >>>>>
> >>>>> ArchLinux version:
> >>>>>
> >>>>> Linux msi 3.15.5-2-ARCH #1 SMP PREEMPT Fri Jul 11 07:56:02 CEST 2014
> >>>>> x86_64 GNU/Linux
> >>>>>
> >>>>> My Pharo VM version:
> >>>>>
> >>>>> 3.9-7 #1 Thu May 15 18:29:30 CEST 2014 gcc 4.6.3 [Production ITHB VM]
> >>>>> NBCoInterpreter NativeBoost-CogPlugin-GuillermoPolito.19 uuid:
> >>>>> acc98e51-2fba-4841-a965-2975997bba66 May 15 2014
> >>>>> NBCogit NativeBoost-CogPlugin-GuillermoPolito.19 uuid:
> >>>>> acc98e51-2fba-4841-a965-2975997bba66 May 15 2014
> >>>>> https://github.com/pharo-project/pharo-vm.git Commit:
> >>>>> ed4a4f59208968a21d82fd2406f75c2c4de558b2 Date: 2014-05-15 18:23:04
> >>> +0200
> >>>>> By: Esteban Lorenzano <[email protected]> Jenkins build #14826
> >>>>> Linux pharo-linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7
> >>> 16:39:45
> >>>>> UTC 2012 i686 i686 i386 GNU/Linux
> >>>>>
> >>>>> Thank you in advance for your responses!
> >>>>>
> >>>>> Julien
> >>>>>
> >>>>>
> >>>
> >>>
>
>
>

Reply via email to