Comments (6)
That won’t happen if you add -T UTF-8
.
I’m very much unsure whether that is the correct answer or just a workaround. Should rename try to do that for you? Should it try to do that for you but only under specific circumstances?
from rename.
The larger issue is that --noctrl
should, by default, only replace the 33 control characters defined by ASCII. This way it works with ASCII filenames and UTF-8 filenames. I'm very much a beginner at Perl so I won't try too hard to guess at what the program does, but it seems like the character class [:cntrl:]
is somehow matching more than just the ASCII control characters.
Upon further reading it seems like [:cntrl:]
is Unicode-aware with use feature 'unicode_strings'
and rename automatically enables a feature bundle for the user's version of Perl. This breaks when the strings are not Unicode, which is the case when rename is run without any -T
args.
from rename.
You’re right.
The larger issue is that
--noctrl
should, by default, only replace the 33 control characters defined by ASCII.
I take it you’re saying it should use Unicode-aware [:cntrl:]
under -T
?
from rename.
You’re right.
The larger issue is that
--noctrl
should, by default, only replace the 33 control characters defined by ASCII.I take it you’re saying it should use Unicode-aware
[:cntrl:]
under-T
?
For -T
, I'm not really sure what the best path is. Currently rename does match all Unicode control characters under -T
, so it would be a breaking change to restrict it to the control characters defined by ASCII.
I think the simplest solution is to no feature 'unicode_strings'
if the user hasn't specified -T
.
from rename.
I think the simplest solution is to
no feature 'unicode_strings'
if the user hasn't specified-T
.
Just for --noctrl
or in general? Doing that in general would affect all patterns, including those in user code passed with -e
.
from rename.
I think the simplest solution is to
no feature 'unicode_strings'
if the user hasn't specified-T
.Just for
--noctrl
or in general? Doing that in general would affect all patterns, including those in user code passed with-e
.
In general. As it stands enabling feature unicode_strings
is incorrect when the internal encoding for a string is not utf-8. Looking at https://metacpan.org/pod/Unicode::Semantics, I imagine one could devise many examples of rename(1) outputting broken utf-8.
from rename.
Related Issues (12)
- Bareword found where operator expected HOT 5
- utf-8 stuff HOT 1
- --delete and --delete-all in the man pages HOT 1
- -z on macOS have bugs HOT 5
- Bug with Corner cases in renaming impossible file names HOT 1
- -N flag rejects patterns that don't start with 0 HOT 1
- missing license for the repo HOT 2
- where is this packaged? HOT 2
- `-c` not working on case-insensitive systems like macOS
- Can you add a release or tag? HOT 2
- The transform -X not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rename.