What are these unknown symbols that show up in my HTML when using Notepad?

3

1

These characters can be found by me in Notepad when writing HTML. It absolutely causing problems for me. I can’t even delete it!

So does anyone knows this symbol is or why it appears? I’ve tried to Google it, and it can’t find it.

My HTML is as follows:

<td class="ti"> 冰箱 </td>
<td> bīng xiāng </td>
<td> Freezer </td>

And here are two screenshots to show you what I am seeing.

This is what it looks like in Firefox:

Firefox

And this is what it looks like in Google Chrome:

Google Chrome

Phoenix

Posted 2020-01-22T01:17:06.223

Reputation: 31

Which input method / locale are you using? – Kenneth L – 2020-01-22T02:18:56.503

It was copy and paste the chinese characters or type them in, then switch to english input. – Phoenix – 2020-01-22T02:23:10.927

1

It may be Unicode character U+001E which led me to this question: https://stackoverflow.com/questions/23232692/what-is-a-rs-in-a-htmltext-file. It seems they faced a similar issue and I've experienced this too when copying between different applications. If I copy 001E from that page into Notepad++ I see the RS symbol. Try copying the whole line of code into a hexadecimal editor like https://hexed.it/ and see what you get. Are there two 1E characters before where class begins?

– MC10 – 2020-01-22T04:26:12.187

Yes, but I can't delete them. Also they were edited by one Notepad, so there isn't a problem of copying. – Phoenix – 2020-01-22T04:45:40.880

They are invisible and the only way to notice is if you scroll through the code with arrow keys, and there is a delay.I checked it, and they are 1E (without the zeroes). – Phoenix – 2020-01-22T04:54:47.587

Answers

4

When saving text files using Notepad, the default text encoding format is set to ANSI. On the other hand, if you open a text file in an application that's using a different encoding, the computer displays whatever the character corresponds to.

Converting the file from ANSI encoding to UTF-8 will remove the incorrect formatting. In Notepad select File -> Save As, choose UTF-8 from the dropdown menu next to Encoding, change the font to Times New Roman in order to save the Chinese characters properly, and click the Save button. Your file will be converted and saved in the UTF-8 format.

How to display Chinese characters on Notepad?

karel

Posted 2020-01-22T01:17:06.223

Reputation: 11 374

1You cannot enter Chinese characters unless it is an unicode format. I chose UTF-8. – Phoenix – 2020-01-22T03:35:05.830

Next, I don't know how those 001E got there, and saving it in unicode will save those characters, because they can be represented by Unicode (UTF-16, don't use this because it causes problem when uploading to sites), but I use UTF-8 (which saves it as well). – Phoenix – 2020-01-22T15:49:39.690

Times New Roman font works in Notepad for Chinese character with UTF-8 encoding, but the default Lucida Console font doesn't work in Notepad with UTF-8. – karel – 2020-01-22T15:52:33.250

It is set to Consolas, and even if it is the default font, they will switch the font so they can display it. – Phoenix – 2020-01-22T15:53:34.667