Piotr Fusik:

I must agree that "UTF-8" vs "UTF-8 Cookie" can be confusing for people new to 
SciTE.
It's especially how these options affect how the file is saved.

  The naming was based mostly on opening the file and showing that
the user's code.page setting was being overridden by the file
contents. UTF-8 follows UCS-2 Little Endian and  UCS-2 Big Endian as
being BOM based. UTF-8 Cookie will only appear on open if there is a
cookie in the file. If the user is unfamiliar with the term "cookie"
then it gives them something to look for in the SciTE documentation.

The former writes a BOM.  The latter does not write a BOM and it does not add
a "cookie" for you.

  SciTE doesn't add the cookie itself as it is just a little too
dangerous. The start of the file often contains other metadata such as
#! lines, config for Emacs/vi, and compulsory copyright notices.
Inserting a line may push other information out of the metadata area
and #! lines can't be moved at all. When you know what is permitted in
your environment you can add your own function which both adds the
cookie text and tells SciTE:

function SetCookie()
  editor.TargetStart = 0
  editor.TargetEnd = 0
  preferredCookie = "# -*- coding: utf-8 -*-\n"
  editor:ReplaceTarget(preferredCookie)
  scite.MenuCommand(154)
end

In my opinion "UTF-8 with BOM" and "UTF-8 without BOM" would be more adequate.
This precisely describes how the file is saved.  The only thing you need to 
learn
is how SciTE recognizes UTF-8 when there's no BOM.  I don't think that "cookie"
is a commonly used term for that.

  Sometimes the term "coding declaration" or "encoding declaration"
is used but  thats more common with XML/HTML whereas I've seen
"cookie" more often with source code.

  Neil
_______________________________________________
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to