Community
    • Login

    Character in UTF mode appears as an empty character (stroked square)!

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 2 Posters 1.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JamesWebbJ
      JamesWebb
      last edited by JamesWebb

      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.

      ss.png

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @JamesWebb
        last edited by

        @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).

        JamesWebbJ 1 Reply Last reply Reply Quote 3
        • JamesWebbJ
          JamesWebb @PeterJones
          last edited by JamesWebb

          @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):
          directWrite.png

          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-N7SEcu8XNpkOnLD9Fj4TDwz89jRJPbM

          You can see the specific font which I used (in previous SS) supports the missing characters (SS below):
          characterMap.png

          PeterJonesP 1 Reply Last reply Reply Quote 1
          • PeterJonesP
            PeterJones @JamesWebb
            last edited by

            @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 of new 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.

            JamesWebbJ 1 Reply Last reply Reply Quote 0
            • JamesWebbJ
              JamesWebb @PeterJones
              last edited by

              @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?

              PeterJonesP 1 Reply Last reply Reply Quote 0
              • PeterJonesP
                PeterJones @JamesWebb
                last edited by

                @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 have cue in the Ext.: entry field box.
                d2ce7307-d7ea-4cd0-a174-0d45d9671cca-image.png

                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
                2939ec15-c503-447f-b904-6e260c4cdfc8-image.png
                … and maybe Language=Global, Style=Global Override to make sure that none of the “enable global xxx” are checked on:
                5065c579-90ee-4665-9915-e4b11abc59cf-image.png

                JamesWebbJ 1 Reply Last reply Reply Quote 2
                • JamesWebbJ
                  JamesWebb @PeterJones
                  last edited by

                  @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.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors