Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding special caracters for filename #24

Open
tcitworld opened this issue Apr 23, 2014 · 2 comments
Open

Encoding special caracters for filename #24

tcitworld opened this issue Apr 23, 2014 · 2 comments

Comments

@tcitworld
Copy link
Contributor

Let's say I want to create an ebook with the title containing a |, like « some text | some text », and a chapter with the same name.
The table of contents is linking to my chapter as some text | some text.html, but the html file created (corresponding to the chapter) is named some text _ some text.html. So I can't access my first chapter.

I'm currently putting PHPePub into wallabag, and without this issue, it works great.

@tcitworld
Copy link
Contributor Author

Okay, here's what I've edited (and seems not so bad) :

  • I've applied function sanitizeFileName() at line 1703 at $fileName to get a correct filename into my TOC.
  • I've added the line $fileName = $this->sanitizeFileName($fileName); after line 345 for getting a properly ouput for each of my chapters.

What I got :
All spaces are converted into dashes - and my special character is gone, so I've got something like some-text-some-text.html.

Oh, and I've just realised I've got another example : I've got a chapter named some/text and before my modification it created a folder named some with a text.html file. Now I just a sometext.html file.

So it's not perfect, but at least it's working for me. Any ideas ?

@tcitworld
Copy link
Contributor Author

Any news ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant