Character in UTF mode appears as an empty character (stroked square)!
-
Re: Unicode character displayed as an empty box.
Why the exact same character with same font with same Unicode (UTF-8) appears as different character in “Microsoft Notepad” and “NP++”?
Fonts are same, and the specific font supports characters which NP++ displays as blank square! Both files are saved as utf-8.
-
@ten2120 ,
Just because MS Windows Notepad shows a character when a given font is selected doesn’t necessarily mean that the character is really in that font. MS uses some cheater methods to style certain characters with glyphs from a different font without telling you. Unfortunately, that same technique is not implemented in Notepad++ (I don’t know whether it’s because MS doesn’t tell other apps how to do that, or if the developers just haven’t learned that trick).
However, when there are glyph-display issues, playing with Settings > Preferences > MISC > Use Direct Write setting will sometimes improve how Notepad++ displays Unicode characters
The other thing I’d be curious about is whether your file is really valid UTF-8, or if MS Notepad is seeing an invalid character (maybe a Windows-1252
Ü
at 0xDC instead of the correct UTF-8 representation of U+00DC which is two bytes 0xC3 0x9C in the raw file). -
@peterjones Thanks. That was big help, but I am not pro user of notepad++ and just use it instead of MS notepad because of its better flexibility (specially in editing a text, also comparing two files with plugin…).
As you said perfect (!) the original file is “ANSI”. I did convert the file to UTF-8. I changed the option (as you mentioned) in “MISC.” and all went good but it changed the font and the style (SS below):
If you have time you can inspect the file (link below, is a music cue sheet, just search the “RUFUS” or “Tiesto” name in that cue file):
https://mega.nz/file/tkB0TRhA#q2QUTYjsYx7-N7SEcu8XNpkOnLD9Fj4TDwz89jRJPbMYou can see the specific font which I used (in previous SS) supports the missing characters (SS below):
-
@ten2120 ,
all went good
I am glad interpreting the file as ANSI in Notepad++ allowed the file to be read with correct characters.
but it changed the font and the style (SS below)
Changing the encoding in Notepad++ does not affect the styling/font selected in Notepad++. Maybe it’s because you renamed the file to
.cue
instead ofnew 1
, so maybe it applied a UDL (User Defined Lanuguage) styling to the file based on the extension. If so, then check your UDL settings for whatever the UDL name is for.cue
files. -
@peterjones I don’t know what is UDL but as I realized I can set specific style for specific file type (?)
I did open the UDL dialog but I don’t know how to apply my “NP++” general style there!
Is there a better option (without enabling “DirectWrite”) to fix the problem?
-
@ten2120 ,
without enabling “DirectWrite”
The two have nothing to do with each other. DirectWrite is solely for how Notepad++ deals with Unicode characters, and might affect how the selected font renders said characters… but it does not change the selected font or otherwise affect the styling.
did open the UDL dialog but I don’t know how to apply my “NP++” general style there!
You don’t. If you want a
.cue
file to behave like a normal text file, then just make sure there isn’t a UDL assigned to that extension. That’s really easy to check: in the UDL dialog, go to the User Language pulldown. Select each in there one at a time. Make sure none of them havecue
in the Ext.: entry field box.
By default,
cue
isn’t associated with any of the regular lexers. So if you don’t have a UDL defining cue and you don’t have it assigned to a normal lexer, then it should be using the Notepad++ defaults. In which case, you need to check the Style Configurator’s Language=Global, Style=Default Style , to make sure the default font is what you think it is
… and maybe Language=Global, Style=Global Override to make sure that none of the “enable global xxx” are checked on:
-
@peterjones Many thanks. You are pro user (of NP++) and I know nothing about “NP++”!
I always have checked all “Enable global xxx…” on. I unchecked them and changed “Default Style” (in Style Config) to my specific font and it fixed that :) . The missing characters are shown with that specific font and style.
Thanks again… It was my headache for a long time.