bugMIT/GNU Scheme - Bugs: bug #58893, read-xml-file fails with files...

 
 

bug #58893: read-xml-file fails with files that are not Unicode NFC-encoded

Submitted by:  Arthur A. Gleckler <aag>
Submitted on:  Mon 03 Aug 2020 07:03:37 PM UTC  
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  Chris Hanson <cph> Originator Name: 
Open/Closed:  Closed
Keywords: 

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 22 Feb 2021 07:16:19 AM UTC, comment #2: 

This should be fixed now on HEAD. Please confirm.

Chris Hanson <cph>
Project AdministratorIn charge of this item.
Mon 03 Aug 2020 07:10:03 PM UTC, comment #1: 

P.S.: Here's a simple workaround, but it requiring loading the whole XML file into memory:

(open-input-string (string->nfc (read-entire-file pathname)))

read-entire-file simply loads the entire file into memory as a string.

Arthur A. Gleckler <aag>
Project Member
Mon 03 Aug 2020 07:03:37 PM UTC, original submission:  

Given a file that is not NFC-encoded, this expression fails:

(read-xml-file "/tmp/reproduce.xml")
;The object "\nx xxxxxxx xxxxxx xx xxxx xxxxxx xx xxxx xxxxxx xx xx xxxxx xxxx, <x>xxx xxx xx xxxxx,</x> xxx xx xxxxxxxx xx xxx xxxxxxx xxx xxx xxxxxxx. xxx “xxx xx xxxxx” xxx xxxx xxxx xxx xxxxxx xxxxx xxxx xxxx xxxxx. x xxx xxxxx xx xx xxxxx xxxx xxxxxxxxxxx xxxx xxx xxxxx xx xxxxxxxxxx xxxxxxx xxx xxxxxxxx xx xxx’x xxx xxxxxxxxxxxxx. xxx xxxx xxxx xx xxxxxxxxxxx xxxx xxx xxxxx xx xxxxxxxxxx xxxx xxxxx xx xxxxxxxxxxxxx xxxx, xx xxxxxxxx xxxxxxx, xxxxxxxxxxx xxx xx xxx xxxxx xxxxx xxxxxxxx xx xxx xxxx. (xxx ...", passed as an argument to string-find-first-index, is not the correct type.
;To continue, call RESTART with an option number:
; (RESTART 1) => Return to read-eval-print level 1.

2 error>

I've attached the offending file, which was part of a podcast feed.  In order to avoid copyright issues, I've replaced [a-zA-Z] with "x" throughout the textual content.

read-xml-file reads the same file file after normalization using Emacs's ucs-normalize-NFC-region.

Arthur A. Gleckler <aag>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #49620:  reproduce.xml added by aag (24KiB - text/xml)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cph (Posted a comment)
  • -email is unavailable- added by aag (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-02-22 aag Open/ClosedOpen => Closed
    2021-02-22 cph StatusNone => Fixed
        Assigned toNone => cph
    2020-08-03 aag Attached File- => Added reproduce.xml, #49620

    Back to the top


    Powered by Savane 3.5