[Vm-dev] primitiveClipboardText mangling line endings

Levente Uzonyi leves at elte.hu
Sun Oct 26 00:29:32 UTC 2014

Nice find. The textenc parameter works. I found this in the man page of 

    -textenc enc
                  specifies the external  character  encoding  to  be  used  by
                  Squeak    when   exchanging   clipboard   text   with   other
                  applications.   The  default  is  UTF-8  on  Mac  OS  X and
                  ISO-8859-15 (aka Latin9) on other Unix systems. Note that X11
                  applications   requesting   the   selection   converted   to
                  UTF8_STRING  data will (correctly) receive the clipboard text
                  encoded as UTF-8, regardless of this setting.
                  Squeak recognizes a subset of the encoding names  defined  by
                  the  IANA.  (If  you prefer to use the international currency
                  symbol rather than the Euro symbol in external text then  you
                  might want to set this to ISO-8859-1, aka Latin1.)

So the default encoding is Latin9, but that doesn't make any sense to me.


On Sat, 25 Oct 2014, Eliot Miranda wrote:
> Ugh, *why* does X11 have to be so complicated?  Why does Ian's VM code 
have to be so complicated?  I've discovered that there's a -textenc flag 
for the VM.  If you do
> squeak -textenc UTF8 myimage.image
> in both images then you'll get all 127 characters copied across.  I'd 
immediately make this the default but 
> a) there is no command-line argument to select the default, what ever 
that is
> b) I *don't know* what the default is called, so I can't figure out a 
name.  It's not that simple to determine.  here's the operative code from 
> static char *getSelectionFrom(Atom source)
> {
>   char * data= NULL;
>   size_t bytes= 0;
>   /* request the selection */
>   Atom target= textEncodingUTF8 ? xaUTF8String : (localeEncoding ? 
xaCompoundText : XA_STRING);
> Further down there's
> # if defined(X_HAVE_UTF8_STRING)
>       if (uxUTF8Encoding == sqTextEncoding)
>         Xutf8TextPropertyToTextList(stDisplay, &textProperty, &strList, 
>       else
> # endif
>         XmbTextPropertyToTextList(stDisplay, &textProperty, &strList, 
> So I guess at one point UTF8 support was added, hence it not being the 
default.  Any objections to us making it the default now?
> Ugh...
> --
> best,Eliot

More information about the Vm-dev mailing list