Comments (10)
If I understand you correctly, your point is that the replacement character should not occur in sanitised filenames on Windows. Why?
from sigtop.
because the replacement character is its own, valid character. so unless a user intentionally used that in the user name, then it should be replaced in the output
from sigtop.
Again, why? You seem to assume that the output has to be unambiguous. But that's not a goal here.
from sigtop.
because its a worse representation of the original input. if you were just wanting to replace invalid UTF-8 with replacement characters, you could just do this:
runes := []rune(name)
but you're also replacing characters:
Lines 58 to 60 in 0c7a8fe
in which case the replacement character should also be replaced, to signify something is invalid in the original input. otherwise you cant disambiguate from an intentional replacement character and one resulting from invalid UTF-8
from sigtop.
otherwise you cant disambiguate
As I've already told you, unambiguity is not a goal. That would require modifying valid filenames, too. I don't want to do that.
from sigtop.
That would require modifying valid filenames, too.
how is that? my suggestion would only impact input that contains invalid UTF-8
from sigtop.
Suppose f
is an invalid filename. Let g := sanitiseFilename(f)
. Valid filenames are not to be modified, so sanitiseFilename(g) == g
. Therefore, sanitiseFilename(f) == sanitiseFilename(g)
, even though f != g
.
from sigtop.
I dont see how that answers the question. a filename with invalid UTF-8 is not valid, so would necessarily need replacement.
from sigtop.
I'm very sorry, but I'm going to close this.
from sigtop.
OK well I tried. if you have a justification why invalid UTF-8 is acceptable for a filename, I would be interested to hear it.
from sigtop.
Related Issues (20)
- Not enough tokens to parse JSON HOT 1
- Sigtop selective export HOT 2
- Issues with accessing exported browser file HOT 6
- Precombiled Windows app crashes immediately after opening. HOT 1
- cannot install on linux: "cannot use path@version syntax in GOPATH mode" HOT 2
- sigtop: cannot prepare statement: no such column: uuid HOT 2
- If I don't want to run sigtop on the production database of my signal desktop, how do I run it? HOT 1
- Export to HTML and link attachments HOT 6
- Program detected as a virus HOT 2
- "att -M" command throws error "utimes: unsupported flag" HOT 6
- Emoji in chat title HOT 8
- Bash Command not found HOT 1
- brew installation error: "go build: Error: Passed `nil` into T.must" HOT 2
- -i option for messages HOT 1
- Not a database error when running sigtop db HOT 13
- Attachments decryption HOT 2
- Feature: Include contact names in JSON message export HOT 2
- skipping attachment without path HOT 2
- cannot decrypt database key: cannot find encryption key HOT 3
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 sigtop.