Skip to content
Snippets Groups Projects
Commit 1dc1fd4f authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix pasting in X11 mode... pastebuf should be UTF-8, not ISO-Latin1.

parent 1769a003
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -1734,9 +1734,9 @@ x11_event(XEvent *ev)
x11.XGetWindowProperty(dpy, win, ev->xselection.property, 0, 0, True, AnyPropertyType, &pastebuf_format, &format, &len, &bytes_left, (unsigned char **)(&pastebuf));
if(bytes_left > 0 && format==8) {
x11.XGetWindowProperty(dpy, win, ev->xselection.property, 0, bytes_left, True, AnyPropertyType, &pastebuf_format, &format, &len, &dummy, (unsigned char **)&pastebuf);
if (A(UTF8_STRING) && pastebuf_format == A(UTF8_STRING)) {
if (!(A(UTF8_STRING) && pastebuf_format == A(UTF8_STRING))) {
char *opb = pastebuf;
pastebuf = (char *)utf8_to_cp(CIOLIB_ISO_8859_1, (uint8_t *)pastebuf, '?', strlen(pastebuf), NULL);
pastebuf = (char *)cp_to_utf8(CIOLIB_ISO_8859_1, (uint8_t *)pastebuf, strlen(pastebuf), NULL);
if (pastebuf == NULL)
pastebuf = opb;
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment