Libation
Libation copied to clipboard
Character replacement failed on stylized single quote
Describe the bug I tried liberating this book, you'll notice the author's name is written with a stylized closing single quote. I have both stylized single quotes setup to be replaced with a standard single quote:
"ReplacementCharacters": {
"Replacement": [
{
"CharacterToReplace": "\u0000",
"ReplacementString": "_",
"Description": "All other invalid characters"
},
{
"CharacterToReplace": "/",
"ReplacementString": "_",
"Description": "Forward Slash (Filename Only)"
},
{
"CharacterToReplace": "\\",
"ReplacementString": "_",
"Description": "Back Slash (Filename Only)"
},
{
"CharacterToReplace": "\"",
"ReplacementString": "'",
"Description": "Open Quote"
},
{
"CharacterToReplace": "\"",
"ReplacementString": "'",
"Description": "Close Quote"
},
{
"CharacterToReplace": "\"",
"ReplacementString": "'",
"Description": "Other Quote"
},
{
"CharacterToReplace": "<",
"ReplacementString": "{",
"Description": "Open Angle Bracket"
},
{
"CharacterToReplace": ">",
"ReplacementString": "}",
"Description": "Close Angle Bracket"
},
{
"CharacterToReplace": ":",
"ReplacementString": "-",
"Description": "Colon"
},
{
"CharacterToReplace": "‘",
"ReplacementString": "'",
"Description": "opening single quote"
},
{
"CharacterToReplace": "’",
"ReplacementString": "'",
"Description": "closing single quote"
}
]
},
Here is the resulting folder, note the stylized quote.
drwxr-xr-x 3 k8s k8s 3 Aug 12 21:47 'Robert O’Brien'
To Reproduce Steps to reproduce the behavior:
- Setup your Settings.json with the above replacements
- Try liberating the book
Expected behavior I'd expect it to write the author's folder name using the substituted single quote
Platform Linux -- Docker image https://hub.docker.com/r/pixil/libation Sorry there isn't any documentation written for the Docker image yet. I'd be happy to help set it up if you want to try using it.
Log Files Log202208.log
Right now, character replacement only works for illegal path/filename characters and is not a general character replacement tool.
Illegal Windows Filename Characters
| \0 \u0001 \u0002 \u0003 \u0004 \u0005 \u0006 \a \b \t \n \v \f \r \u000e \u000f \u0010 \u0011 \u0012 \u0013 \u0014 \u0015 \u0016 \u0017 \u0018 \u0019 \u001a \u001b \u001c \u001d \u001e \u001f * ? : "@rmcrackan This should probably be converted to a feature request
@Mbucari Good call
@Mbucari This gets even more fun in x-plat. A user noted we're replacing colon even though it's a valid path character in Linux.
Great! XD
Fixed in @Mbucari 's latest PR -- #412 . Will go out with the next release