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

Fix illegal encoding for MacRomanEncoding #238

Closed
wants to merge 1 commit into from

Conversation

daneren2005
Copy link

With Mac in the from encoding, would get the following error: mb_convert_encoding(): Illegal character encoding specified. Fixes #229

rbairwell added a commit to silktide/pdfparser that referenced this pull request Jun 19, 2019
rbairwell added a commit to silktide/pdfparser that referenced this pull request Jun 19, 2019
Copy link
Collaborator

@k00ni k00ni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @daneren2005, can you ... (posted list outdated, see the latest at the bottom)

@daneren2005
Copy link
Author

I made my own package because I gave up. I don't intend on spending any more time on this. If anyone else wants to spend the time they are more then welcome.

@k00ni
Copy link
Collaborator

k00ni commented May 30, 2020

Hello @daneren2005, no problem, thank your for your efforts though. I will re-open this PR, maybe we can finish it another time.

If someone else wants to help, this is what is left to do here:

  • add a small test case which shows the faulty behavior (with a PDF if possible),
  • build on top of current master branch

Name change in composer.json can be ignored.

@k00ni k00ni reopened this May 30, 2020
With Mac in the from encoding, would get the following error: `mb_convert_encoding(): Illegal character encoding specified`.  Fixes smalot#229
@j0k3r
Copy link
Collaborator

j0k3r commented Jun 2, 2020

I cleaned up the PR.
We are now waiting for a PDF sample to reproduce the bug and ensure the PR is fixing the issue.

@fbett
Copy link

fbett commented Jun 17, 2020

test.pdf

This file reproduces the problem.

@k00ni
Copy link
Collaborator

k00ni commented Jun 24, 2020

I created the branch pr/238 here and tried the PDF given by @fbett. The PDFParser is fine in PHP 5.6 - 7.4, but raises an error in PHP 8.0. He complains:

mb_convert_encoding(): Argument #3 ($from) contains invalid encoding "Mac"

https://travis-ci.org/github/smalot/pdfparser/jobs/701562931#L257

As far as i can tell no one changed related code, so why is the error gone before PHP 8.0?


With the fix from daneren2005 all tests run without an error on all PHP versions. 👍

https://travis-ci.org/github/smalot/pdfparser/builds/701564912

Left to do:

  • add PDF file from @fbett to this PR (which triggered the problem in PHP 8) - the code of this PR is outdated therefore its not possible to just add PDF file
  • close this PR (because its code is outdated)
  • merge in pr/238 instead (its based on the work of daneren2005)

Any objections?

@k00ni
Copy link
Collaborator

k00ni commented Jun 25, 2020

Closed, replacement will be merged instead: #313

Thank you for your effort everyone!

@k00ni k00ni closed this Jun 25, 2020
k00ni added a commit that referenced this pull request Jun 26, 2020
* try fix from @daneren2005 (from #238) to fix failing test in PHP 8.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mb_convert_encoding(): Illegal character encoding specified
4 participants