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

Parsing XML file with Unicode characters causes problem #47992

Closed
jaylogan mannequin opened this issue Aug 31, 2008 · 2 comments
Closed

Parsing XML file with Unicode characters causes problem #47992

jaylogan mannequin opened this issue Aug 31, 2008 · 2 comments
Labels
topic-XML type-bug An unexpected behavior, bug, or error

Comments

@jaylogan
Copy link
Mannequin

jaylogan mannequin commented Aug 31, 2008

BPO 3742
Nosy @ezio-melotti
Files
  • read_song_xml.py: Python program to load an XML file argument
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2009-02-21.03:15:31.813>
    created_at = <Date 2008-08-31.19:43:38.076>
    labels = ['expert-XML', 'type-bug', 'invalid']
    title = 'Parsing XML file with Unicode characters causes problem'
    updated_at = <Date 2009-02-21.03:15:31.812>
    user = 'https://bugs.python.org/jaylogan'

    bugs.python.org fields:

    activity = <Date 2009-02-21.03:15:31.812>
    actor = 'benjamin.peterson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-02-21.03:15:31.813>
    closer = 'benjamin.peterson'
    components = ['XML']
    creation = <Date 2008-08-31.19:43:38.076>
    creator = 'jaylogan'
    dependencies = []
    files = ['11319']
    hgrepos = []
    issue_num = 3742
    keywords = []
    message_count = 2.0
    messages = ['72211', '82519']
    nosy_count = 2.0
    nosy_names = ['ezio.melotti', 'jaylogan']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue3742'
    versions = ['Python 3.0']

    @jaylogan
    Copy link
    Mannequin Author

    jaylogan mannequin commented Aug 31, 2008

    Python 3.0b2 will not parse the XML file located at
    http://rubyquiz.com/SongLibrary.xml.gz

    It complains of a UnicodeEncodeError
    'charmap' codec can't encode character '\xc8' in position 45: ch
    aracter maps to <undefined>

    I included a sample program, just in case I was doing something wrong
    while coding.

    Python 3.0b2 (r30b2:65106, Jul 18 2008, 18:44:17) [MSC v.1500 32 bit
    (Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.

    @jaylogan jaylogan mannequin added topic-XML type-bug An unexpected behavior, bug, or error labels Aug 31, 2008
    @ezio-melotti
    Copy link
    Member

    The encoding used by the windows terminal (usually cp850) is not able to
    encode all the characters, so when you print the text that you extract
    from the xml file the terminal is not able able to display some
    characters. If you remove the print() it works fine. You can also try to
    write the results on a file using utf-8.

    This issue can be closed.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-XML type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants