<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 25, 2014 at 4:18 PM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Hi Eliot,<span class=""><br>
<br>
On Sat, 25 Oct 2014, Eliot Miranda wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Is there some magic X11 setting that could account for your issue?<br>
</blockquote>
<br></span>
No, at least not intentionally. I tried to check if there are any settings that could affect the clipboard encoding, but I didn&#39;t find anything. It seems like only utf-8 is supported.<br>
<br>
I&#39;m pretty sure it&#39;s related to the VM, because when I copy some text from another application, and paste it into an image, then the line endings are converted to CRs, which is very unlikely to happen on linux.<br>
<br>
I tried to copy all 7-bit ascii characters to the clipboard (besides zero which is not possible), because those are the same in utf-8:<br>
<br>
Clipboard default primitiveClipboardText: (1 to: 127) asByteArray.<br>
<br>
When I checked it with xclip, it turned out that all the bytes are on the clipboard:<br>
<br>
$ xclip -o -selection clipboard | hexdump -b;<br>
0000000 001 002 003 004 005 006 007 010 011 012 013 014 012 016 017 020<br>
0000010 021 022 023 024 025 026 027 030 031 032 033 034 035 036 037 040<br>
0000020 041 042 043 044 045 046 047 050 051 052 053 054 055 056 057 060<br>
0000030 061 062 063 064 065 066 067 070 071 072 073 074 075 076 077 100<br>
0000040 101 102 103 104 105 106 107 110 111 112 113 114 115 116 117 120<br>
0000050 121 122 123 124 125 126 127 130 131 132 133 134 135 136 137 140<br>
0000060 141 142 143 144 145 146 147 150 151 152 153 154 155 156 157 160<br>
0000070 161 162 163 164 165 166 167 170 171 172 173 174 175 176 177<br>
000007f<br>
<br>
But in the other image, the bytes were filtered:<br>
<br>
Clipboard default primitiveClipboardText asByteArray. #[9 13 27 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126]</blockquote><div><br></div><div>Ugh, *why* does X11 have to be so complicated?  Why does Ian&#39;s VM code have to be so complicated?  I&#39;ve discovered that there&#39;s a -textenc flag for the VM.  If you do</div><div><br></div><div>squeak -textenc UTF8 myimage.image</div><div><br></div><div>in both images then you&#39;ll get all 127 characters copied across.  I&#39;d immediately make this the default but </div><div>a) there is no command-line argument to select the default, what ever that is</div><div>b) I *don&#39;t know* what the default is called, so I can&#39;t figure out a name.  It&#39;s not that simple to determine.  here&#39;s the operative code from platforms/unix/vm-display-X11/sqUnixX11.c:</div><div><br></div><div><div>static char *getSelectionFrom(Atom source)</div><div>{</div><div>  char * data= NULL;</div><div>  size_t bytes= 0;</div><div><br></div><div>  /* request the selection */</div><div>  Atom target= textEncodingUTF8 ? xaUTF8String : (localeEncoding ? xaCompoundText : XA_STRING);</div></div><div><br></div><div><br></div><div>Further down there&#39;s</div><div><br></div><div><div># if defined(X_HAVE_UTF8_STRING)</div><div>      if (uxUTF8Encoding == sqTextEncoding)</div><div>        Xutf8TextPropertyToTextList(stDisplay, &amp;textProperty, &amp;strList, &amp;n);</div><div>      else</div><div># endif</div><div>        XmbTextPropertyToTextList(stDisplay, &amp;textProperty, &amp;strList, &amp;n);</div></div><div><br></div><div>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?</div><div><br></div></div><div>Ugh...</div>-- <br>best,<div>Eliot</div>
</div></div>