all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacs clipboard handling for X broken?
@ 2004-08-31 14:48 Werner LEMBERG
  2004-08-31 23:10 ` Kenichi Handa
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Werner LEMBERG @ 2004-08-31 14:48 UTC (permalink / raw)



[Emacs CVS 2004-08-22]

I tried to paste text from Mozilla 1.6 (build 2004011400) into Emacs,
and I get e.g. for Chinese instead of `不想睡' the following:

  \x{4E0D}\x{60F3}\x{7761}

I tried many coding systems in Emacs for the X selection (C-x RET x),
but all give the same result -- perhaps I've missed the right
one...  To be sure that it isn't a Mozilla problem or a problem of the
Window manager (I use fvwm 2.5.9), I pasted the text into the Unicode
editor yudit (version 2.7.6), and it worked.

Interestingly, pasting Chinese from Emacs to Mozilla (and to yudit)
works fine.

Another observation is that the mozilla's window border also show
\x{...} instead of Chinese characters...

Is this a known problem?  I'm lost and ask for help.


    Werner

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs clipboard handling for X broken?
  2004-08-31 14:48 emacs clipboard handling for X broken? Werner LEMBERG
@ 2004-08-31 23:10 ` Kenichi Handa
  2004-09-02  5:15   ` Werner LEMBERG
  2004-09-01  2:38 ` Miles Bader
  2004-09-06  5:08 ` Janusz S. Bień
  2 siblings, 1 reply; 8+ messages in thread
From: Kenichi Handa @ 2004-08-31 23:10 UTC (permalink / raw)
  Cc: emacs-devel

In article <20040831.164842.180119251.wl@gnu.org>, Werner LEMBERG <wl@gnu.org> writes:
> [Emacs CVS 2004-08-22]

> I tried to paste text from Mozilla 1.6 (build 2004011400) into Emacs,
> and I get e.g. for Chinese instead of `不想睡' the following:

>   \x{4E0D}\x{60F3}\x{7761}

I can't reproduce it, but anyway, as Emacs itself never
generate such a string, it was what Mozilla sent to Emacs.

By default, Emacs issues two requests of types COMPOUND_TEXT
and UTF8_STRING and chooses the longer one.

Please try to set x-select-request-type to a symbol
UTF8_STRING or COMPOUND_TEXT.

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs clipboard handling for X broken?
  2004-08-31 14:48 emacs clipboard handling for X broken? Werner LEMBERG
  2004-08-31 23:10 ` Kenichi Handa
@ 2004-09-01  2:38 ` Miles Bader
  2004-09-06  5:08 ` Janusz S. Bień
  2 siblings, 0 replies; 8+ messages in thread
From: Miles Bader @ 2004-09-01  2:38 UTC (permalink / raw)
  Cc: emacs-devel

Werner LEMBERG <wl@gnu.org> writes:
> I tried to paste text from Mozilla 1.6 (build 2004011400) into Emacs,
> and I get e.g. for Chinese instead of `不想睡' the following:
>
>   \x{4E0D}\x{60F3}\x{7761}
...
> Is this a known problem?  I'm lost and ask for help.

FWIW, I can cut and paste japanese just fine in both directions between
Emacs (started with `-q', so the defaults seem OK) and mozilla-firefox
0.9.3 (I think this roughly corresponds to mozilla 1.7.2).

selection-coding-system's value is `compound-text-with-extensions'.

LANG is set to `ja_JP.UTF-8'.

I've noticed in the past that the setting of LANG is crucial to making
Mozilla do CJK cut-n-paste correctly, and that in general Mozilla is
pretty fucked up in this area -- if LANG is _not_ set `properly', then
it will screw up cut-n-paste.

Here's Mozilla bug report that may be related:

   http://bugzilla.mozilla.org/show_bug.cgi?id=137659

-Miles
-- 
Occam's razor split hairs so well, I bought the whole argument!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs clipboard handling for X broken?
  2004-08-31 23:10 ` Kenichi Handa
@ 2004-09-02  5:15   ` Werner LEMBERG
  2004-09-02  5:18     ` Werner LEMBERG
  0 siblings, 1 reply; 8+ messages in thread
From: Werner LEMBERG @ 2004-09-02  5:15 UTC (permalink / raw)
  Cc: emacs-devel

> > I tried to paste text from Mozilla 1.6 (build 2004011400) into
> > Emacs, and I get e.g. for Chinese instead of `不想睡' the
> > following:
>
> >   \x{4E0D}\x{60F3}\x{7761}
>
> [...]
>
> Please try to set x-select-request-type to a symbol
> UTF8_STRING or COMPOUND_TEXT.

This did the trick, thanks!  I've added it to my .emacs file.  Your
solution is apparently independent on Mozilla's locale (I've started
it with `en_US.ISO-8859-1' ).


    Werner

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs clipboard handling for X broken?
  2004-09-02  5:15   ` Werner LEMBERG
@ 2004-09-02  5:18     ` Werner LEMBERG
  2004-09-04 12:10       ` Kenichi Handa
  0 siblings, 1 reply; 8+ messages in thread
From: Werner LEMBERG @ 2004-09-02  5:18 UTC (permalink / raw)
  Cc: emacs-devel

> > Please try to set x-select-request-type to a symbol
> > UTF8_STRING or COMPOUND_TEXT.
> 
> This did the trick, thanks!

Using `UTF8_STRING', that is.


    Werner

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs clipboard handling for X broken?
  2004-09-02  5:18     ` Werner LEMBERG
@ 2004-09-04 12:10       ` Kenichi Handa
  2004-09-05 12:31         ` Alex Schroeder
  0 siblings, 1 reply; 8+ messages in thread
From: Kenichi Handa @ 2004-09-04 12:10 UTC (permalink / raw)
  Cc: emacs-devel

In article <20040902.071819.174335908.wl@gnu.org>, Werner LEMBERG <wl@gnu.org> writes:

>>  > Please try to set x-select-request-type to a symbol
>>  > UTF8_STRING or COMPOUND_TEXT.
>>  
>>  This did the trick, thanks!

> Using `UTF8_STRING', that is.

I see.  So, your mozilla produces bogus sequence upon a
request of COMPOUND_TEXT.  Have you tried a newer mozilla?  

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs clipboard handling for X broken?
  2004-09-04 12:10       ` Kenichi Handa
@ 2004-09-05 12:31         ` Alex Schroeder
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Schroeder @ 2004-09-05 12:31 UTC (permalink / raw)
  Cc: emacs-devel

Kenichi Handa <handa@m17n.org> writes:

> In article <20040902.071819.174335908.wl@gnu.org>, Werner LEMBERG <wl@gnu.org> writes:
>
>>>  > Please try to set x-select-request-type to a symbol
>>>  > UTF8_STRING or COMPOUND_TEXT.
>>>  
> I see.  So, your mozilla produces bogus sequence upon a
> request of COMPOUND_TEXT.  Have you tried a newer mozilla?  

I'm using Firefox 0.9 and pasting characters that can be encoded as
Latin-1 works with setting x-select-request-type to either value.  The
default is nil, and that works as well.

When trying to paste chinese characters from an UTF-8 encoded page,
I get the following results:

(setq x-select-request-type 'UTF8_STRING)
 -> works.

(setq x-select-request-type 'COMPOUND_TEXT)
 -> pastes entry from kill-ring

(setq x-select-request-type nil)
 -> pastes unicode escapes like this: \u5167\u5bb9\u76ee\u9304\u64f4\u5145

This reminds me of the native format used by Java properties files:
They are Latin-1 encoded, and use unicode escapes for everything
else.  Very weird...   :(

My Emacs from CVS was built 2004-08-12.

Alex.
-- 
.O.  http://www.emacswiki.org/alex/
..O  Schroeder's fifth law:
OOO  Never accept more work than you can handle in one night of hacking.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacs clipboard handling for X broken?
  2004-08-31 14:48 emacs clipboard handling for X broken? Werner LEMBERG
  2004-08-31 23:10 ` Kenichi Handa
  2004-09-01  2:38 ` Miles Bader
@ 2004-09-06  5:08 ` Janusz S. Bień
  2 siblings, 0 replies; 8+ messages in thread
From: Janusz S. Bień @ 2004-09-06  5:08 UTC (permalink / raw)


On Wed, 1 Sep 2004  Kenichi Handa <handa@m17n.org> wrote:

> In article <20040831.164842.180119251.wl@gnu.org>, Werner LEMBERG <wl@gnu.org> writes:
> > [Emacs CVS 2004-08-22]
> 
> > I tried to paste text from Mozilla 1.6 (build 2004011400) into Emacs,
> > and I get e.g. for Chinese instead of `不想睡' the following:
> 
> >   \x{4E0D}\x{60F3}\x{7761}
> 
> I can't reproduce it, but anyway, as Emacs itself never
> generate such a string, it was what Mozilla sent to Emacs.

I'm afraid the problem is more general. I am almost sure I was getting such
string when pasting from kanjipad some time ago. If I remember well,
the problem has gone with a newer version of Emacs and/or kanjipad.

On Sun, 05 Sep 2004  Alex Schroeder <alex@emacswiki.org> wrote:

[...]

>  -> pastes unicode escapes like this: \u5167\u5bb9\u76ee\u9304\u64f4\u5145

I can get these escape sequences when pasting Polish letters from
Galeon to Emacs 21.2.1 and 21.3.1 while with CVS Emacs both Polish
letters (and kanji) are pasted correctly. See Debian bug

        http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=258114

BTW, when pasting from konqueror with ctext I get just question marks
in place of non-ASCII characters.

Regards

Janusz

-- 
                     ,   
dr hab. Janusz S. Bien, prof. UW -  Uniwersytet Warszawski (Katedra Lingwistyki Formalnej)
Prof. Janusz S. Bien - Warsaw Uniwersity (Chair of Formal Linguistics)
jsbien@mimuw.edu.pl, jsbien@uw.edu.pl, http://www.mimuw.edu.pl/~jsbien/, http://www.klf.uw.edu.pl

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-09-06  5:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-31 14:48 emacs clipboard handling for X broken? Werner LEMBERG
2004-08-31 23:10 ` Kenichi Handa
2004-09-02  5:15   ` Werner LEMBERG
2004-09-02  5:18     ` Werner LEMBERG
2004-09-04 12:10       ` Kenichi Handa
2004-09-05 12:31         ` Alex Schroeder
2004-09-01  2:38 ` Miles Bader
2004-09-06  5:08 ` Janusz S. Bień

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.