buglibiconv - Bugs: bug #39238, Fixing bad utf8.

 
 

bug #39238: Fixing bad utf8.

Submitted by:  None
Submitted on:  Wed 12 Jun 2013 11:04:32 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Tue 10 Sep 2013 10:02:09 AM UTC, comment #1:

I am experiencing a similar issue: the invalid sequence \U3e3965 is not correctly removed. This is a problem since PCRE does not accept this character and generates an error.

# Correctly removed
$ echo -e "\xff" | iconv --from=UTF-8 --to=UTF-8 -c

# Not removed as it should
$ echo -e "\xf8\x8f\xa3\xa5\xa5" | iconv --from=UTF-8 --to=UTF-8 -c
���

Milan Bouchet-Valat <nalimilan>
Wed 12 Jun 2013 11:04:32 AM UTC, original submission:

Hi,

I'm trying to clean utf8 encoded buffer using iconv and remove all invalid utf8 code points(below is my code snippet)

iconv_t conv = iconv_open("UTF-8//IGNORE","UTF-8");
iconvctl(conv, ICONV_SET_DISCARD_ILSEQ, &flag);
iconv(conv, &inbuf, &len, &outbuf, &outlen);
iconv_close(conv);

I noticed that it is not able to remove code points in range of 0xD800-0xDfff (surrogate pairs) even though these are not valid utf8 code points.

Other invalid code points like beyond 0x10FFFF and wrong/broken utf8 byte sequence is are cleaned successfully.

What might be the issue here?

Thanks,
Anurag

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by nalimilan (Posted a comment)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup