Re: Copy & paste

Björn Kautler <[email protected]> Fri, 17 Nov 2023 12:16:24 +0100
Newsgroups gmane.editors.jedit.user
Message-ID <CAKChYSp+oBNBTmgRQNFzAtW1RqYSBbVAmBFgvVy+yNH-7QF=gg@mail.gmail.com>
--===============0105438876229798641==
Content-Type: multipart/alternative; boundary="000000000000f6a955060a574490"

--000000000000f6a955060a574490
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Robert.

Since Java 18 the default encoding of the Java runtime changed.
Before it was the default system encoding (for example often Windows-1252
on Windows, but not necessarily), from Java 18 on it is UTF-8.
As the pasting to other programs works fine, I suspect that the VBA editor
is misbehaving here.
Or maybe it uses the "unicode" encoded clipboard flavor which is
problematic to be used anyway as "unicode" is not a defined encoding and
thus can mean different things.

The characters that are pasted to the VBA editor also support this
suspicion.
This is exactly the result you get when you encode those characters using
UTF-8 and decode them using for example ISO-8859-1 or Windows-1252.

To reinstate the previous behavior, you need to start jEdit with the system
property `-Dfile.encoding=3D...` with the system default encoding the VBA
editor expects as argument.
Then the pasting works like expected again.

Cheers
Bj=C3=B6rn


Am Do., 16. Nov. 2023 um 18:05 Uhr schrieb Robert Schwenn <
[email protected]>:

> Hi,
> I'm on Windows 10 and 11 and have been running in a usability problem
> after using jEdit 5.6 with Java 20 or 21:
>
> When I copy the text "a =C3=A4 =C3=B6 =C3=BC =C3=9F z" from jEdit into th=
e (say Excel) VBA
> editor (yes, I'm still using this dino), the text appears there as "a =C3=
=83=C2=A4 =C3=83=C2=B6
> =C3=83=C2=BC =C3=83=C5=B8 z". This doesn't happen when copying from other=
 programs or pasting
> into other programs or using jEdit with Java 17 ;-). And the encoding use=
d
> in jEdit doesn't matter.
>
> Whatever there's going on, Java is involved in changing the copy & paste
> behavior. So I'd like to say "Jave, do this as before (until version 17)"=
.
> Is this possible, may be via command line option?
>
> Thanks,
> Robert
> --
> -----------------------------------------------
> jEdit Users' List
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jedit-users
>

--000000000000f6a955060a574490
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Robert.<div><br></div><div>Since Java 18 the default en=
coding of the Java runtime changed.</div><div>Before it was the default sys=
tem encoding (for example often Windows-1252 on Windows, but not necessaril=
y), from Java 18 on it is UTF-8.</div><div>As the pasting to other programs=
 works fine, I suspect that the VBA editor is misbehaving here.</div><div>O=
r maybe it uses the &quot;unicode&quot; encoded clipboard flavor which is p=
roblematic to be used anyway as &quot;unicode&quot; is not a defined encodi=
ng and thus can mean different things.</div><div><br></div><div>The charact=
ers that are pasted to the VBA editor also support this suspicion.</div><di=
v>This is exactly=C2=A0the result you get when you encode those characters =
using UTF-8 and decode them using for example ISO-8859-1 or Windows-1252.</=
div><div><br></div><div>To reinstate the previous behavior, you need to sta=
rt jEdit with the system property `-Dfile.encoding=3D...` with the system d=
efault encoding the=C2=A0VBA editor expects as argument.</div><div>Then the=
 pasting works like expected again.</div><div><br></div><div>Cheers</div><d=
iv>Bj=C3=B6rn</div><div><br></div></div><br><div class=3D"gmail_quote"><div=
 dir=3D"ltr" class=3D"gmail_attr">Am Do., 16. Nov. 2023 um 18:05=C2=A0Uhr s=
chrieb Robert Schwenn &lt;<a href=3D"mailto:[email protected]">Ro=
[email protected]</a>&gt;:<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex"><u></u>

 =20

   =20
 =20
  <div>
    <p><font face=3D"monospace">Hi,<br>
      </font><font face=3D"monospace">I&#39;m on Windows 10 and 11 and have
        been</font><font face=3D"monospace"> running in a usability
        problem after using jEdit 5.6 with Java 20 or 21:=C2=A0</font></p>
    <p><font face=3D"monospace">When I copy the text &quot;a =C3=A4 =C3=B6 =
=C3=BC =C3=9F z&quot; from
        jEdit into the (say Excel) VBA editor (yes, I&#39;m still using thi=
s
        dino), the text appears there as &quot;a =C3=83=C2=A4 =C3=83=C2=B6 =
=C3=83=C2=BC =C3=83=C5=B8 z&quot;. This doesn&#39;t
        happen when copying from=C2=A0</font><font face=3D"monospace">other
        programs or</font><font face=3D"monospace"> pasting into other
        programs or using jEdit with Java 17 ;-). And the encoding used
        in jEdit doesn&#39;t matter.<br>
      </font></p>
    <p><font face=3D"monospace">Whatever there&#39;s going on, Java is
        involved in changing the copy &amp; paste behavior. So I&#39;d like
        to say &quot;Jave, do this as before (until version 17)&quot;. Is t=
his
        possible, may be via command line option?</font></p>
    <p><font face=3D"monospace">Thanks,<br>
        Robert<br>
      </font></p>
  </div>


-- <br>
-----------------------------------------------<br>
jEdit Users&#39; List<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">jEdi=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/jedit-users" rel=3D=
"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo=
/jedit-users</a><br>
</blockquote></div>

--000000000000f6a955060a574490--


--===============0105438876229798641==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============0105438876229798641==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-- 
-----------------------------------------------
jEdit Users' List
[email protected]
https://lists.sourceforge.net/lists/listinfo/jedit-users

--===============0105438876229798641==--