Micah Cowan wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Deckard Cain wrote:
I use  wget to recursive download  a web to download some files in a
FTP. I have a Ubuntu PC with zh-CN.utf-8 locale , but I think the FTP
server is cp936 locale . So, the filename I get is all like
"???????"(cp936 on utf8 Can't read it ).
In my windows PC. I do same things ,and  filenames is right , like
"中文歌曲"(chinese)
What should i do if I want get right filename when I download them with wget ?
Help me ,please .

Unfortunately, Wget does not do any transcoding of filenames. The most
it will do is to replace unsupported characters.

This may be altered in the near future (there is a related Google
Summer-of-Code proposal that at least touches on the problem), but for
now, any filename transcoding would need to be done outside of Wget. Sorry!

That being said, on GNU platforms at least, you may be able to handle
the transcoding using the "iconv" tool. For instance:

  $ n=<the weird filename>
  $ mv "$n" "$(echo "$n" | iconv -f WINDOWS-936 -t UTF-8)"

I'd recommend doing the part between the $(...) part separately first,
to make sure it produces the output you desire. As to how to get the
variable "n" to contain the filename, that may be a small challenge. If
you're lucky, selecting the filename in your terminal and pasting it
into the assignment to n may do. Otherwise, it may be tricky.

- --
Good luck, anyway,
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer,
and GNU Wget Project Maintainer.
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH8prq7M8hyUobTrERApJ0AJ48KdB0cBibPKM7HwiCy6DN3Mn/fACeOJ8M
foS+s5q5rmobEJoeGf6dBUA=
=mHEn
-----END PGP SIGNATURE-----
Thank you very much to reply my post !
You said that "n=<the weird filename>"....but I can't read the filenames -it looks like "???????"- so I can't type is in my console. Then I try to use "find -exec" with commands you given , but I failed to. Fortunately I found a tool "convmv" . It can convert any code filenames to UTF-8.

By the way "convmv" is a perl script . I wish wget could convert filenames in the future.

best wishes!

Reply via email to