Community
    • 登入

    UTF-8 doc becomes ANSI doc !

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    24 貼文 6 Posters 25.8k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • gerdb42G
      gerdb42 @Claudia Frank
      最後由 編輯

      @Claudia-Frank

      Let’s assume a file contains Byte-sequence 20-A9-20 (in ANSI this would be Space-Copyright-Space). This Sequence is invalid in UTF-8 so NPP has no alternative other than assuming an single-Byte encoding. And since it never does changes to the file’s content on its own, it is left to treat such a file as ANSI (or whatever your favorite single-Byte encoding is).

      This is not a shortcoming of NPP but part of that single-Byte heritage we still have to deal with today.

      Claudia FrankC 1 條回覆 最後回覆 回覆 引用 1
      • Claudia FrankC
        Claudia Frank @gerdb42
        最後由 編輯

        @gerdb42

        I assume we have the same understanding so I’m interested to know
        what I have written that could be misunderstood?
        Could you point me to my error?

        Thank you and cheers
        Claudia

        gerdb42G 1 條回覆 最後回覆 回覆 引用 0
        • gerdb42G
          gerdb42 @Claudia Frank
          最後由 編輯

          @Claudia-Frank said:
          Not quite an error, but

          I would also find it very useful if the setting
          New Document->Encoding: UTF-8 and Apply to opened ANSI files (or any other configured encoding)
          would force npp to treat all new opened documents as “configured encoding” when
          auto detection of encoding has been disabled.

          would require an implicit conversion to UTF-8. And besides breaking the principle of not doing changes without user action, it will pop up a whole bunch of other issues.

          Claudia FrankC 1 條回覆 最後回覆 回覆 引用 1
          • Claudia FrankC
            Claudia Frank @gerdb42
            最後由 編輯

            @gerdb42

            I agree that this would break the principle but on the other hand it could be beneficial as well.
            But, now as I’m typing I’m thinking, when this conversion takes place and you don’t know from which encoding it came from
            you might corrupt the document without knowing how to fix it.
            Yes - bad idea.

            Cheers
            Claudia

            1 條回覆 最後回覆 回覆 引用 0
            • 第一個貼文
              最後的貼文
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors