Mail Archives: djgpp/1999/11/11/02:36:47
On Wed, 10 Nov 1999 lcl99 AT my-deja DOT com wrote:
> > The size regs (dx:ax) always come back 0. Any idea why?
> >
> I found the problem myself. Before the 0x1704 call to get the size of
> the clipboard, I wasn't setting dx to 1 (the data type).
Setting DX to 1 is not a good idea. Specifically, it will fail if the
text in the clipboard was put there by a Windows (as opposed to DOS)
application that used some non-ASCII characters. You need to use format
code 7 (OEM Text), because that's what DOS applications support with the
installed codepage. When you use OEM Text, Windows automatically
converts any non-ASCII characters to their DOS encoding, which differs
from the Windows encoding.
I even saw cases where using format 1 yields an incorrect length of the
text in the clipboard, which produces garbage after you paste it. 7 is
much better.
- Raw text -