Giter Club home page Giter Club logo

Comments (4)

metachris avatar metachris commented on August 28, 2024

Thanks for reporting! Can you send me the pdf which produces the error?
On Nov 18, 2015 19:44, "davemcphee" [email protected] wrote:

C:\Users\User\Desktop\python\CouncilAgendaMapper>pdfx --debug agenda.pdf
DEBUG - init - Init with uri: agenda.pdf
Document infos:

  • Author = blah
  • CreationDate = D:20151106153359-06'00' Traceback (most recent call
    last): File "C:\Python33\lib\runpy.py", line 160, in run_module_as_main
    "main", fname, loader, pkg_name) File "C:\Python33\lib\runpy.py",
    line 73, in run_code exec(code, run_globals) File
    "C:\Python33\Scripts\pdfx.exe__main
    .py", line 9, in File
    "C:\Python33\lib\site-packages\pdfx\cli.py", line 90, in main print("- %s =
    %s" % (k, parse_str(v).strip("/"))) File
    "C:\Python33\lib\encodings\cp437.py", line 19, in encode return
    codecs.charmap_encode(input,self.errors,encoding_map)[0]
    UnicodeEncodeError: 'charmap' codec can't encode character '\xae' in
    position 21 : character maps to

Not sure what the correct way to handle encoding errors would be, skip the
char?

I usually fix this kind of issue by changing the cmd window encoding, eg.:
cmd> chcp 65001


Reply to this email directly or view it on GitHub
#13.

from pdfx.

davemcphee avatar davemcphee commented on August 28, 2024

Hi Chris,

sure thing, I think it was this:
http://www.austintexas.gov/edims/document.cfm?id=242173

I know nothing about PDF encoding, but I do know about parsing HTML from
that source, and it's all generated in MS Word, so expect a horror show
inside that PDF. Good luck :)

On Wed, Nov 18, 2015 at 4:24 PM Chris Hager [email protected]
wrote:

Thanks for reporting! Can you send me the pdf which produces the error?
On Nov 18, 2015 19:44, "davemcphee" [email protected] wrote:

C:\Users\User\Desktop\python\CouncilAgendaMapper>pdfx --debug agenda.pdf
DEBUG - init - Init with uri: agenda.pdf
Document infos:

  • Author = blah
  • CreationDate = D:20151106153359-06'00' Traceback (most recent call
    last): File "C:\Python33\lib\runpy.py", line 160, in run_module_as_main
    "main", fname, loader, pkg_name) File "C:\Python33\lib\runpy.py",
    line 73, in run_code exec(code, run_globals) File
    "C:\Python33\Scripts\pdfx.exe__main
    .py", line 9, in File
    "C:\Python33\lib\site-packages\pdfx\cli.py", line 90, in main print("-
    %s =
    %s" % (k, parse_str(v).strip("/"))) File
    "C:\Python33\lib\encodings\cp437.py", line 19, in encode return
    codecs.charmap_encode(input,self.errors,encoding_map)[0]
    UnicodeEncodeError: 'charmap' codec can't encode character '\xae' in
    position 21 : character maps to

Not sure what the correct way to handle encoding errors would be, skip
the
char?

I usually fix this kind of issue by changing the cmd window encoding,
eg.:
cmd> chcp 65001


Reply to this email directly or view it on GitHub
#13.


Reply to this email directly or view it on GitHub
#13 (comment).

from pdfx.

metachris avatar metachris commented on August 28, 2024

Just a note: I've found out that this problem is caused by the Windows console not being able to display unicode characters. I'm going to look into a solution.

from pdfx.

metachris avatar metachris commented on August 28, 2024

Should work now on the Github version. CLI tries to encode contents to console encoding:

def print_to_console(text):

from pdfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.