bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Question: It is possible to change/select local filesyste


From: Tony Lewis
Subject: Re: [Bug-wget] Question: It is possible to change/select local filesystem encoding?
Date: Tue, 30 Oct 2012 09:21:39 -0700

Alex wrote:

> It is possible to add options something like "--local-filesystem-encoding"
> to convert filenames to given encoding? Or what is better way to do (now
> parse log to get URI-encoded name, then decode it to CP866 and rename
files.
>  Bat-file http://dl.dropbox.com/u/27457022/rus_site.zip ) Sorry for bad
>  English.

wget has an option that directs it to convert characters in the generated
file name:
  --restrict-file-names=MODES

where MODES is one of: `unix', `windows', `nocontrol', `ascii', `lowercase',
and `uppercase'

You might try --restrict-file-names=nocontrol to see how close that comes to
the behavior you want. Here is what the info page says about `nocontrol':

     If you specify `nocontrol', then the escaping of the control
     characters is also switched off. This option may make sense when
     you are downloading URLs whose names contain UTF-8 characters, on
     a system which can save and display filenames in UTF-8 (some
     possible byte values used in UTF-8 byte sequences fall in the
     range of values designated by Wget as "controls").

If there are still some issues then I think supporting your request would
require adding a mode that converted UTF-8 characters to the local character
set (with escape for any characters that cannot be converted).

Perhaps others on the list have an idea for how to easily implement this.

Tony 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]