Fri Mar 06 07:00:27 2009: Request 43889 was acted upon.
Transaction: Correspondence added by dbec...@roadrunner.com
       Queue: Win32-Clipboard
     Subject: Re: [rt.cpan.org #43889] Win32::Clipboard::GetText() doesn't 
convert newlines
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: kwittr...@web.de
      Status: new
 Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=43889 >


K. Wittrock via RT wrote:
> 
> MS Windows uses \r\n for Newline, while Perl uses \n. So 
> Win32::Clipboard::GetText()
> should perform a "$text =~ s/\r$//mg;" before returning the text. Otherwise 
> the \r
> is treated as part of the text by Perl.

That's kinda debatable.  GetText returns the string contained in the
clipboard - I see no conversion documented or implied.  But it would
be nice if it stated how it handled newlines just for this type of
situation.

The text in the clipboard could possibly be text without \r's too.
If you always strip the \r, you eliminate the ability to get a DOS
CRLF from the clipboard even if you wanted one.

I'd rather leave it and document it or add a strip option than change
it.

Reply via email to