What is the difference between EM Dash #151; and #8212;?

后端 未结 4 537
春和景丽
春和景丽 2020-12-09 15:50

I\'ve an ASCII file that contains an EM Dash (— or in HTML). The hex value is 0x97. When we pass this file through one application it arrives as UTF

4条回答
  •  情深已故
    2020-12-09 16:10

    An ASCII file can not contain the character 0x97, as the ASCII character set only ranges from 0x00 to 0x7F. Therefore your file is not ASCII, but some other single byte encoding. The windows-1250 encoding for example has the em-dash at 0x97.

    If the applications decode the text file using some other encoding than the one that was used to create the file, any character above 0x7F will be wrong.

    In unicode the em-dash has the character code 0x2014, or 8212 in decimal.

    Unicode Character 'EM DASH' (U+2014)

    In a web page that for example uses windows-1250 as encoding, the code will render as an em-dash:

    
    
    
        em-dash
        
    
    
        

提交回复
热议问题