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

Re: [maybe OT] unicode control characters in filenames



On Wednesday 10 August 2011 19:04:57 Mike McClain wrote:
> <snip>
> 
> > myuser@mysytem:~/path-name-of-unicode-files$ rename -n 's/\x{202A}//' *
> > 
> > I get no output although x{202A} is definitely the first char in the
> > filename. This definitely needs more than a cursory view into perl -
> > exactly what I wanted to avoid.
> > Maybe I better post in a perl mailinglist. Only I'm afraid that I'll get
> > nothing but RTFM! and "do your own homework!" - they maybe right ...
> 
> Sorry to hear my suggestion about tr didn't help you.
> Try this:
> ls *file.ext | hd
>     to be sure you know what characters are in the filename, then
> prename -n 's/\x20\x2A//' *file.ext
>     or what ever the characters turn out to be
> Mike

Thank you Mike!

prename -v 's/\xe2\x80\xac//' *file.ext got me going. Didn't know about hd 
before - duh!
And I just was not really on the right scent with the unicode. It is composed 
of three bytes, not two as I asumed.
With two renames, one after another I was able to eliminate the control 
characters.
It was all a bug of FlashGot 1.3.0.4 in connection with curl.
FlashGot 1.3.0.5 does not have this problem anymore, instead it is stripping 
the last character of the filename (not the extension) now. I filed a bug 
report.

Thnx again
Greetings
Eike


Reply to: