git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: Convert Content-Disposition filenames into qtext
Date: Sat, 07 Oct 2006 14:11:38 +0200	[thread overview]
Message-ID: <eg85ga$9g6$1@sea.gmane.org> (raw)
In-Reply-To: 20061007114602.GX20017@pasky.or.cz

Petr Baudis wrote:

> Dear diary, on Sat, Oct 07, 2006 at 12:06:31PM CEST, I got a letter
> where Jakub Narebski <jnareb@gmail.com> said that...
>> >>>> +  $str =~ s/\r/\\r/g;
>> >>> 
>> >>> \r? Not \n?
>> >>
>> >> Yes, \r, not \n.
>> > 
>> > \r to \\r? Not to \\\r?
>> 
>> We want "\r" in suggested filename, not "\
>> " I think, so it is "\\r".
> 
> Oh, yes. Lubin wants. It looked sane until I've read it as you
> explicitly wrote it. ;-)
> 
> That's "obviously" wrong. In qtext, \r means just r, no special
> interpretation is done. So we indeed _would_ want "\
> ". Which is of course a nice trap for buggy browsers so in fact we
> obviously do not want that. I think it's not wort the potential problems
> to try to carry newlines in the header, so I would just replace that
> line with
> 
>       $str =~ s/[\n\r]/_/g;
> 
> as per Junio's suggestion.

Bu the way, using the following script:

-- >8 --
#!/usr/bin/perl

use strict;
use warnings;
use CGI qw(:standard :escapeHTML -nosticky);

binmode STDOUT, ':utf8';

our $cgi = new CGI;

print $cgi->header(
        -type => 'text/plain',
        -charset => 'utf-8',
        -content_disposition => 'inline; filename="test\".\\"test\\n.\\\n"');

print "TEST\n";
-- >8 --

I've checked that at least Mozilla 1.7.12 wants to using "\n"
in file name instead of literal eoln.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

  reply	other threads:[~2006-10-07 12:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-06 19:18 [PATCH] gitweb: Convert Content-Disposition filenames into qtext Luben Tuikov
2006-10-06 19:20 ` Petr Baudis
2006-10-06 19:30   ` Luben Tuikov
2006-10-07  9:46     ` Junio C Hamano
2006-10-07 10:06       ` Jakub Narebski
2006-10-07 10:34         ` Junio C Hamano
2006-10-07 18:01           ` Luben Tuikov
2006-10-07 11:46         ` Petr Baudis
2006-10-07 12:11           ` Jakub Narebski [this message]
2006-10-07  9:05 ` Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='eg85ga$9g6$1@sea.gmane.org' \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).