Space escape character () encountered during Database Import from Excel ()

Source: Internet
Author: User

When I import data to the gridview in an Excel file, I find that some data fails to be imported. After debugging in the background

The reason is that some fields have spaces in Excel and are displayed as & #160;
Not the one I used to filter. & nbsp;
After checking the information, I found that & nbsp; is the escape of HTML spaces and & #160; is the escape of space in Excel. In fact, I don't know

Not many tools developed by Microsoft do not use & #160; as space escape, and then I will take a closer look at it because

Excel will output unknown escape characters as is, for example, & nbsp; it will output & nbsp; which should be generated by Excel

The reason for the HTML, and then query the information to obtain
: & Nbsp ;==& #160 ;=& # xa0 ;== no-break Space
Then Microsoft uses & #160; instead of & nbsp? Probably because Microsoft considers the blogArticleIt may be stored in XML format, and & nbsp is not the default XML entity. Actual

Many HTML symbolic character references are not included in XML. Slave

Http://www.w3.org/tr/html4/sgml entities.htmlcan be informed of the pre-Definition of nbspin in dtdin html:

<! Entity nbsp CDATA "& #160;" -- no-break Space = non-breaking space, U + 00a0

Isonum->
Therefore, you can use it only when & NBPS is defined in the DTD. (This segment is a copy)

 

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.