07/02/11 Yasushi Masuda<[EMAIL PROTECTED]> wrote:
> Instead, I'd like to propose making get_valid_filename() as default
> behaviour of ``filename_normalization``, and adding a
> ``filename_nomalizer`` parameter in FileField's constructor, like this::
I completely agree with Yasushi.
The point is
Makoto, Michael, Gabor, Ivan:
In the discussion, I'm getting to think that the definition/policy of
the "valid filename (for storage)" may vary for circumstances or fields
where individual developer concerns, thus it should be hard to provide
the ultimate-flawless way for nomalizing filename. Eve
Michael Radziej wrote:
> No, I'd propose simply to use the file system's encoding for files
> within the file system, that's all,
This will fail in some cases. The problem is that file system itself
doesn't check (nor enforce) any encoding in file names. And files may
come to server from differ
Michael Radziej wrote:
> Gábor Farkas:
>>
>> 1. we do not mandate yet that GET/POST data is in settings.DEFAULT_CHARSET
>
> We don't mandate any particular encoding in
> settings.DEFAULT_CHARSET? Take a look at ticket #951 and the recent
> discussion about it here.
i'm sorry, are you sure that i
Gábor Farkas:
> but, if i understand correctly, you propose it to behave like:
>
>
> =
> filename1 =
> request.POST.somehow_get_the_filename_i_do_not_want_to_look_it_up_right_now()
>
> # let's pray that the user's html templates
> # are encoded using settings.DEFAUL
Michael Radziej wrote:
> Gábor Farkas:
>> Michael Radziej wrote:
>>>* What encoding does python use if you pass unicode to open()?
>> for os.listdir it uses sys.getfilesystemencoding(), so i assume it does
>> the same for open().
>>
>> so usually it does the correct thing.
>>
>> so using unic
Gábor Farkas:
> Michael Radziej wrote:
>>* What encoding does python use if you pass unicode to open()?
> for os.listdir it uses sys.getfilesystemencoding(), so i assume it does
> the same for open().
>
> so usually it does the correct thing.
>
> so using unicode filenames are probably fine
Michael Radziej wrote:
> Hi Tsuyuki!
>
> tsuyuki makoto:
>> Proposed solution: punicode conversion before call
>> django.util.text.get_valid_filename.
>
> Why punycode? I'd think that most filesystems these days support UTF-8
> (though, with different normalization, which *is* a problem).
>
>
Hi Tsuyuki!
tsuyuki makoto:
> Proposed solution: punicode conversion before call
> django.util.text.get_valid_filename.
Why punycode? I'd think that most filesystems these days support UTF-8
(though, with different normalization, which *is* a problem).
* Wouldn't it be better to support any
I'd like to ask for comments on #3119: problems on FileField/ImageField
with multi-byte filenames. Since this problem is caused by two reasons,
let me describe them step by step.
Multibyte characters in a filename are lost in get_valid_filaname().
-
10 matches
Mail list logo