emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copying to clipboard silently discards lines


From: Chong Yidong
Subject: Re: copying to clipboard silently discards lines
Date: Fri, 25 Feb 2005 10:09:14 -0500 (EST)
User-agent: SquirrelMail/1.4.4

I sent an email to emacs-pretest-bug earlier about NTEmacs silently
discarding lines copied onto the clipboard. I've identified the problem,
but I don't know enough about coding systems to come up with a fix. Maybe
someone can help me out here.

The bug is in the Lisp_Object QUNICODE, which specifies the "utf-16le-dos"
coding system used by `selection-coding-system'. When a coding_system is
extracted from QUNICODE, the parameter
coding->spec.ccl.encoder.buf_magnification is 1. This causes a call to
encoding_buffer_size (in convert_to_handle_as_coded, w32select.c:247) to
return a buffer size that is too small for the encoded string.

I'm guessing the magnification has to be set to 2, because `abc...' gets
encoded to `a\0b\0c\0...' (encoding_buffer_size multiplies this again by
2, because of the CRLF issue.)

This bug did not exist prior to the unicode support patch, because Emacs
used the iso2022 coding system for selections.

Trouble is, I can't find where the `spec.ccl...', or indeed any of the
other parameters of QUNICODE are initialized. The only place I can see
that sets anything in QUNICODE is w32select.c:1074, which is just

  QUNICODE = intern ("utf-16le-dos");

Could someone with knowledge of coding systems and/or w32select.c help?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]