ralsina / pdfrw

Automatically exported from code.google.com/p/pdfrw
Other
0 stars 0 forks source link

PDFString values containing 2 backslashes are incorrectly decoded #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Call pdfrw.pdfobjects.PdfString.encode on a string containing a double 
backslash.
2. Call .decode() on the pdfstring.

What is the expected output? What do you see instead?
Encoding and then decoding a string, should return the original.

What version of the product are you using? On what operating system?
Latest SVN (revision 136).

Please provide any additional information below.
Patch attached (including a unittest).

Original issue reported on code.google.com by beechhorn on 13 Sep 2011 at 4:28

Attachments:

GoogleCodeExporter commented 9 years ago
Awesome!

I love bug reports that come with code and tests.

I can check this in tonight when I get home. Alternatively, or additionally, 
you can have commit rights if you would like.

Thanks,
Pat

Original comment by pmaupin on 13 Sep 2011 at 4:36

GoogleCodeExporter commented 9 years ago
Have tidied up the test (patch 2 attached).

Will add to it if any more oddities occur. With one 1 bug after usage, there is 
no need for commit rights. However if the situation rises I'll take you up on 
your kind offer.

Thank you for a library that allows arbitrary json data structures to embedded 
directly into a PDF (saves on two separate files for our needs).

Original comment by beechhorn on 13 Sep 2011 at 6:51

Attachments:

GoogleCodeExporter commented 9 years ago
Patch 3 fixes the typo...

Original comment by beechhorn on 13 Sep 2011 at 6:53

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Pat,

Are you planning on applying the patch?

Otherwise please can you give me commit rights.

Original comment by beechhorn on 11 Oct 2011 at 3:25

GoogleCodeExporter commented 9 years ago
Sorry, got sidetracked and forgot.

I had looked at your change and fix and it seemed fine.

You now have commit rights.

Thanks,
Pat

Original comment by pmaupin on 11 Oct 2011 at 5:13

GoogleCodeExporter commented 9 years ago
Fixed by revision r137.

Original comment by beechhorn on 11 Oct 2011 at 7:49