Menu

Format menu: "Encode in" vs "Convert to"

Kal
2008-04-06
2012-11-13
  • Kal

    Kal - 2008-04-06

    Hello,

    Can somebody explain to me the difference between the "Encode in" options and their "Convert to" counterparts in the Format menu?

    Please see if I understand the difference correctly:

    The "Encode in" options tell Notepad++ in what encoding to open files. For instance, if Notepad++ happens to incorrectly detect the encoding of a file as UCS-2 Big Endian, while the correct encoding should be UTF-8 without BOM, then I can select the option "Encode in UTF-8 without BOM" from the Format menu so that the file is correctly interpreted and displayed.

    The "Convert to" options tell Notepad++ in what encoding to save files. For instance, once Notepad++ opens a file and interpretes it with the correct encoding, I can change the encoding of the file on disk by using one of the "Convert to" options.

    If my understanding above is correct, I would suggest that the "Encode in" options be renamed to "Display as" or "Decode as". In any case, "Encode in" would be misleading because when a file is displayed in Notepad++, the file is being DECODED from the encoding and NOT encoded into the encoding.

     
    • Fool4UAnyway

      Fool4UAnyway - 2008-04-06

      Perhaps the information in these links can also be of any help to you.

      "UTF-8 without BOM bug?" (Help forum)
      http://sourceforge.net/forum/forum.php?thread_id=1625701&forum_id=331754

      "saving in utf8" (Help forum)
      http://sourceforge.net/forum/forum.php?thread_id=1893389&forum_id=331754

       
    • Nobody/Anonymous

      It works a little different. When Notepad++ opens a file, it tries to detect the type and convert either to ANSI (current codepage) or UTF-8, because thats the only thing Scintilla supports.
      Convert To allows you to convert between UTF-8 and ANSI.
      UCS2 BE and LE are both represented by UTF8, it only tells notepad how to save the file.
      When switching the encoding, you only tell Notepad++ how to save the file and how to read the current contents. Because UTF-8 is MBCS, sometimes a character wil lbe rendered as 2/3 separate characters, and vice versa.

      My recommendation is to only use Convert To when switching between ANSI and any of the unicode types, and Encode in only when switching between unicode types