Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Trying to unravel a copy/paste puzzle

7 views
Skip to first unread message

Larry W. Virden

unread,
Aug 31, 2005, 9:16:47 AM8/31/05
to
I received an email yesterday from a developer. He is working on a
project which is trying to get copy and paste to work between some Java
applications that his team wrote and some Tcl applications.

He tells me that the Java applications are text editors for files which
contain non-roman characters (Japanese, Korean, Russian, Chinese). The
characters being displayed are Unicode.

The Tcl applications are also displaying the same kinds of characters.

When the user attempts to paste non-roman characters, from one to the
other, all they get is a series of question marks and garbage
characters.

They find that they can copy and paste from tcl to tcl or from java to
java. However, any time they try to go from apps written in one to the
other, they get the garbage/question marks.

Can anyone suggest some things I can try so as to figure out what is
going wrong?

Benjamin Riefenstahl

unread,
Aug 31, 2005, 9:48:22 AM8/31/05
to
Hi Larry,

"Larry W. Virden" writes:
> When the user attempts to paste non-roman characters, from one to
> the other, all they get is a series of question marks and garbage
> characters.

Which OS? The concepts and implementation details of the clipboard
vary wildly between OSes. Also which version of Tk?

benny

William J Poser

unread,
Aug 31, 2005, 11:56:29 AM8/31/05
to
Without more details it is hard to know what the problem is, but a problem
that I ran into when I first tried to do this sort of thing in Tcl
was not specifiying the selection type correctly. Problems of the
sort you describe can arise if you don't specify that the data
takes the form of a UTF-7 string, like this:

selection get -selection CLIPBOARD -type UTF8_STRING

Bill
--
Bill Poser, Linguistics, University of Pennsylvania
http://www.ling.upenn.edu/~wjposer/ bill...@alum.mit.edu

Larry W. Virden

unread,
Aug 31, 2005, 12:22:48 PM8/31/05
to
OS: SPARC Solaris (I believe version 8).

I believe they are currently using Tk 8.3 - I will find out for certain
that one. I know I've made version 8.4.9 available to them; just don't
know if they've upgraded yet or not.

Larry W. Virden

unread,
Aug 31, 2005, 12:49:23 PM8/31/05
to
I confirmed that it is Tk 8.3 and the Java is version 1.42.

I was wondering what it would take to write a little "hello, world"
sized pair of apps, one in java and one in tcl/tk, that could be used
to demonstrate the copy and pasting of non-roman characters. I started
hacking at the java, but even after a couple of self taught courses, my
java skills are still pretty raw. Anyone know of a jva demo that might
have evolved from a tutorial on perhaps copy and paste?

Just trying to set things up so that I can see if the problem is a
local environment limitation, or something being missed by the java
developers (who have never written any tcl/tk code).

Jeff Hobbs

unread,
Sep 11, 2005, 1:44:09 PM9/11/05
to Larry W. Virden

I think that's the key, as it was in 8.4 that we checked to
get UTF8_STRING (if available) before the regular STRING.
Tk always handled COMPOUND_TEXT, but I don't know if Java
ever used that baroque format.

--
Jeff Hobbs, The Tcl Guy
http://www.ActiveState.com/, a division of Sophos

0 new messages