4

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

5
  • Which input method / locale are you using?
    – Kenneth L
    Jan 22, 2020 at 2:18
  • It was copy and paste the chinese characters or type them in, then switch to english input.
    – Phoenix
    Jan 22, 2020 at 2:23
  • 1
    It may be Unicode character U+001E which led me to this question: stackoverflow.com/questions/23232692/…. 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 hexed.it and see what you get. Are there two 1E characters before where class begins?
    – MC10
    Jan 22, 2020 at 4:26
  • Yes, but I can't delete them. Also they were edited by one Notepad, so there isn't a problem of copying.
    – Phoenix
    Jan 22, 2020 at 4:45
  • 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
    Jan 22, 2020 at 4:54

1 Answer 1

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?

4
  • 1
    You cannot enter Chinese characters unless it is an unicode format. I chose UTF-8.
    – Phoenix
    Jan 22, 2020 at 3:35
  • 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
    Jan 22, 2020 at 15:49
  • 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
    Jan 22, 2020 at 15:52
  • It is set to Consolas, and even if it is the default font, they will switch the font so they can display it.
    – Phoenix
    Jan 22, 2020 at 15:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .