Date: Thu, 11 Nov 1999 08:27:04 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: lcl99 AT my-deja DOT com cc: djgpp AT delorie DOT com Subject: Re: Paste Win Clipboard in DOS? In-Reply-To: <80ct0i$kie$1@nnrp1.deja.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.