Package: dwm-tools
Version: 26-2
Severity: normal
Tags: patch

select some utf-8 text, and then sselp

Когда все люди узнают, что красивое является красивым, появляется и
безобразное.

% sselp

\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435
\u043b\u044e\u0434\u0438 \u0443\u0437\u043d\u0430\u044e\u0442,
\u0447\u0442\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0435
\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f
\u043a\u0440\u0430\u0441\u0438\u0432\u044b\u043c,
\u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438
\u0431\u0435\u0437\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0435.


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dwm-tools depends on:
ii  libc6                         2.7-10     GNU C Library: Shared libraries
ii  libx11-6                      2:1.0.3-7  X11 client-side library

Versions of packages dwm-tools recommends:
pn  dwm                           <none>     (no description available)

-- no debconf information

-- 
Alexander Polakov | http://rootshell.be/~polachok/
diff -ur sselp-0.1/sselp.c sselp-0.1h/sselp.c
--- sselp-0.1/sselp.c	2006-10-13 13:11:28.000000000 +0400
+++ sselp-0.1h/sselp.c	2008-05-15 04:56:15.000000000 +0400
@@ -24,6 +24,7 @@
 static unsigned char *
 getselection(unsigned long offset, unsigned long *len, unsigned long *remain) {
 	Display *dpy;
+	Atom utf8_string;
 	Atom xa_clip_string;
 	Window w;
 	XEvent ev;
@@ -36,9 +37,10 @@
 	if(!dpy)
 		return NULL;
 	xa_clip_string = XInternAtom(dpy, "BLITZ_SEL_STRING", False);
+	utf8_string = XInternAtom(dpy, "UTF8_STRING", False);
 	w = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10, 200, 200,
 			1, CopyFromParent, CopyFromParent);
-	XConvertSelection(dpy, XA_PRIMARY, XA_STRING, xa_clip_string,
+	XConvertSelection(dpy, XA_PRIMARY, utf8_string, xa_clip_string,
 			w, CurrentTime);
 	XFlush(dpy);
 	XNextEvent(dpy, &ev);

Reply via email to