Menu

UTF-8 without BOM bug?

2006-12-05
2012-11-13
1 2 > >> (Page 1 of 2)
  • Nobody/Anonymous

    Hi, I've small problem with UTF-8( without BOM ). I wrote some php/html code and save it as UTF-8( without BOM ), but if I open it later, file will be recognized as ANSI, in some cases program recongnizes file encoding correctly

     
    • N Morris

      N Morris - 2009-01-21

      My issue I think is broader.

      My problem is that if I try to open up a file which *does* have plenty of non ANSI chars, specifically HAN chars (chinese/japanese/korean), it just displays squares for those chars. Now I have a foreign language pack installed, and I am running English version of Windows XP SP2.
      In Firefox, the Han characters display just fine, though of course which char set is specified in the html. But it works OK in Excel as well.

      But chars do not display in npp when I open a file or even try and copy and paste a foreign character into npp.

      I could be missing something here .....? or is this a bug?

       
    • Nobody/Anonymous

      This is normal. Notepad parses the file and look for UTF-8 chars on loading. If there are some UTF8 character codes the file will be encoded in UTF8 without BOM. I guess in your file there are only ANSI characters.

      Best Regards
      Jens

       
      • Nobody/Anonymous

        Thank you so much. N++ is a great tool but u should solve this problem: Adding BOM MUST be optional.
        I was using N++, but unfortunately I do not use it anymore because of missing this feature :(

         
        • Nobody/Anonymous

          If I'm not mistaken selecting Format>Encode in ANSI, then selecting Format>UTF-8 without BOM and saving the document encodes the doc in UTF-8 without BOM. When you open the file later its still in that encoding format.

           
          • Nobody/Anonymous

            thx, but another problem occurred !!
            I can not enter Unicode characters in N++, It only use my codepage (1256).
            I can enter Unicode characters directly by the keyboard in Windows Notepad. what is the problem ?

            p.s. : I am using Windows XP Pro SP2, and I have installed both English and Persian(Farsi) keyboard

             
            • Nobody/Anonymous

              I'm using 'UTF-8 without BOM' and haven't had any trouble using unicode characters. For example typing in a HTML document &#x00ED represents the latin small letter i with acute.

               
              • Nobody/Anonymous

                Sorry, forgot the semicolon:

                í

                 
    • Nobody/Anonymous

      Well, I didn't noticed this feature at all. Whichever I choose, UTF-8, or UTF-8 without BOM, when I save the file BOM is added. It doesn't appear on notepad++, but Zend shows it. I really like notepad++, but I need UTF-8 without BOM, is there anything I could do?

       
      • Nobody/Anonymous

        BOM will be added if you are choose UTF8 not (UTF8 without BOM).

         
    • Nobody/Anonymous

      @Jens
      Yes, you've right, in these files I used only ANSI chars, when I use non-ANSI chars, n++ shows encoding as UTF-8 :)
      thank you for info

      Best Regards
      Tom

       
    • Nobody/Anonymous

      I tell you that it doesn't matter which mode I choose. BOM is added anyway. I use notepad2 at the moment, but if notepad++ didn't have this "bug" I would use it.

       
    • Nobody/Anonymous

      I have created a sql file for MySQL 5.x and saved it as utf8 without BOM. When reopened this utf8 file its encoding appears to be ANSI. That is why any MySQL manager like phpmyadmin can't execute such a file. I need this file to be utf8.
      How can I overcome this problem?

       
    • Nobody/Anonymous

      This bug still exists when it should not, I'm using v4.4 of Notepad++. I should in fact be able to select UTF-8 without BOM, especially when I declare the encoding in the document. For example in a HTML document in the meta tag, eg:

      <meta http-equiv="content-type" content="text/html; charset=utf-8" />

       
    • Nobody/Anonymous

      Yes problem is really annoying! Yes I agree if I enter in document special unicode char (for example one Russian alphabet letter) then it correctly recognizes file encoding "UTF-8 without BOM" but sometimes it's not possible to add this letter and then if I reopen document it almost always is detected as clear ANSI.

      For example Our well known editor PSPAD somehow managed this problem, even if I make file with single "a" latter in it and choose encoding UTF-8 without BOM after reopening it recognizes correctly...

      Also if I am writing in this same forsaken :) Russian language characters and forgot to change file codding to UTF-8 and left ANSI then after I switch this language it makes all text unreadable... somehow PSpad managed this problem too...

      Thees are only two things that disturbs coding work and keeps many users to still uses PSpad which is realy bloated and sometimes real crashy.

      Good luck on next release, and hope You could solve these problems ;)

       
      • Don HO

        Don HO - 2007-10-27

        BOM is used as a marker to indicate that text is encoded in UTF-8, UTF-16 or UTF-32.
        Ref :
        http://en.wikipedia.org/wiki/Byte_Order_Mark

        When BOM is not present in a file, Notepad++ tries to look into the file to open, in order to detect the presence of unicode characters. if nothing detected, then it treats opened file as ANSI file.
        As a result,  there's no way to make a ansi file (which contains no BOM neither unicode characters) as a UTF-8 file.

        Don

         
        • Egg

          Egg - 2009-01-09

          I am following this whole discussion now, which is also going on in other threads. I'm doing this because I have the same problem and I can't find a solution for it.

          As far as I can follow, the problem seems to be known, but there is nothing done about it. It even sounds a bit to me like the programers are trying to make it appear as a clever implementation.

          I can absolutely not understand this. To make it clear: This is a big problem. I'm using Notepad since long time now and I have several projects running which all have at least 20 text-files. I cannot change the encoding all the time while trying to work efficiently. It is unbelievable enoying and time-consuming.

          And to me it sound like a problem that is very easy to solve. How about that: Option for files that have neither BOM nor utf-8 characters, how to open them. I could enter 'utf-8' there and I would be very happy again.
          As far as I know, Linux uses utf-8 encoding as a standard for long time already. Why can't I do this with Notepad++ as well? Why messing around with these ugly ANSI-stuff?

          I'm using Notepad++ for a long time now and I was always very happy with this program because it is fast and powerful. I recommended it to many friends - thanks a lot for your wonderful work. But now I'm facing this bug and for the first time I am really annoyed and thinking about to change to another editor.

          Please give me some hope back: Will there be done something about this in the near future?

           
          • Don HO

            Don HO - 2009-01-09

            > But now I'm facing this bug and for the first time I am really annoyed

            What is the bug?

            Don

             
            • Egg

              Egg - 2009-01-10

              The bug is that Notepad opens a utf-8 file as ANSI when there is no utf-8 character in it. This forces me to change the file-format after ever opening of such a file.
              Maybe from a programers point of view this is not a bug - from a developers point of view it is. (With developer I mean someone developing with notepad, not for.)

              Do you think there will be done something about this in near future?

               
              • Don HO

                Don HO - 2009-01-10

                It's not a bug for me.
                However, the behaviour you suggested may be more convenient.

                > Do you think there will be done something about this in near future?

                Yes, you will be able to enforce opened ansi document as utf8 w/o BOM in v5.1.4.
                To do so, just set new document encoding as "UTF-8 without BOM" via preferences dialog.

                Don

                 
                • Egg

                  Egg - 2009-01-10

                  > Yes, you will be able to enforce opened ansi document as utf8 w/o BOM in v5.1.4.
                  > To do so, just set new document encoding as "UTF-8 without BOM" via preferences dialog.
                  >

                  In the preferences dialog I can just set the format for a new file, not for a file I open. So this will be implemented later?

                  Somehow I can't get rid of the feeling that it worked before I installed the last update ...

                  Ah, and thanks a lot for your helpful answers, that's very kind of you.

                   
                  • Don HO

                    Don HO - 2009-01-10

                    > In the preferences dialog I can just set the format for a new file,
                    > not for a file I open. So this will be implemented later?

                    It's implemented and it will be in the next release.
                    If user set new file's encoding as utf8 w/o BOM, then I suppose that an opened ANSI file should be set as utf w/o BOM.

                    > Somehow I can't get rid of the feeling that it worked before I installed the last update ...

                    I ensure you it's not true.

                    Don

                     
                    • Egg

                      Egg - 2009-01-10

                      Sounds really good. How long do you think it will take till the next release? About a week, or more like half a year?
                      I have no feeling for release-times with Notepad, sorry for that ;-).

                      Thanks again for your help.

                       
                      • Don HO

                        Don HO - 2009-01-11

                        > I have no feeling for release-times with Notepad, sorry for that ;-).

                        Not sure what you want to say.

                        > About a week, or more like half a year?

                        You can see Notepad++ release frequency on the Download section, it's quite easy to check for everybody.

                        If you don't want to wait, you can modify the source code yourself to suit your need. After all it's an open source project.

                        Don

                         
        • Nobody/Anonymous

          Is there a way to associate an encoding format with a specific file extension then? so everytime you open a file or save a file that encoding is used by default.

           
1 2 > >> (Page 1 of 2)