PYTHON+PANDAS+OPENPYXL Download xls illegalcharactererror

Source: Internet
Author: User

Just urllib2.unquote_plus decoding is not enough, you need to remove the special characters

Illegal_characters_re = Re.compile (R ' [\000-\010]|[ \013-\014]| [\016-\037]|\XEF|\XBF ')
Value = Illegal_characters_re.sub ("', Origin_value)
Due to the existence of \XEF|\XBF, resulting in string garbled, check this is as Utf-8 BOM existence, need to filter out.

Bom:https://en.wikipedia.org/wiki/byte_order_mark#utf-8

ASCII characters:http://donsnotes.com/tech/charsets/ascii.html

Then, it worked for me.

PYTHON+PANDAS+OPENPYXL Download xls illegalcharactererror

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.