SuperEdi

User: Guest

Search

Please use the
Bug Report Form
if you think you found a software defect.

Use the Contact Form
to send a personal message to Wolfgang.

RSS Feed RSS Feed

Other boards:
Juke
QBrowser
Raduga (English)
Song Requester

Is it possible to set a default encoding when opening file?

Posted on: SuperEdi

From Message

Raymund

2004-06-20 14:02:14

Is it possible to set a default encoding when opening file?

Hi,

Is it possible to set a default encoding when opening files?
Current default (ANSI) does not match the encoding of files I am working on.
Although I associate my file with SuperEdi, I cannot open the file by simply clicking on the flie icon since it will be opened using ANSI encoding and everything is messed up.
I have to execute SuperEdi first, and then select the right encoding before opening my files.
It will be nice if I can set a default encoding for each file type.

BTW, I use SuperEdi to edit files mixing ASCII and BIG5 codes, and find it very useful since this editor is the only one I know that can correctly do syntax highlighting on mixed-code files.
A lot of Thanks.

Sincerely,
Raymund

Wolfgang Loch

2004-06-22 19:30:42

Re: Is it possible to set a default encoding when opening file?

Raymund, when you open one file using a non-standard encoding, SuperEdi will use this encoding for subsequent files. But I find this behaviour is sometimes confusing and I will probably remove this feature in a future version of SuperEdi.
Do you think it would be useful if the the default encoding could be specified depending on the file type or file extension, for example *.utf8, *.big5 etc.?

Raymund

2004-07-04 21:32:19

Re: Is it possible to set a default encoding when opening file?

Yes, the ability to specify default encoding depending on the file type is good enough for me.

Thanks. d(^_^)

Lachlan Hunt

2004-08-11 23:32:01

Re: Is it possible to set a default encoding when opening file?

It should be possible to set the default encoding for all files. I always work with UTF-8, but I have to disable the UTF-8 BOM because it causes problems when writing JSP. So, the file is not automatically detected as UTF-8 and some characters are rendered incorrectly.

Being able to specify the character encoding based on the file type will not always work. How would it be possible if I were writing XML, XHTML of HTML, because they all have an .xml, .xhtml or .html extension respectively, but they can be in any encoding. For XML files it should be able to detect the character encoding from the xml prolog, or default to UTF-8 or UTF-16 as specifed in the spec, depending on the presence of, and which BOM is used. Refer to the XML spec for exact details of determining character encodings of XML files.

For HTML files, it should detect it from the BOM, if included, or the meta element, if included or default to iso-8859-1 (IIRC) or, if set, the user's configured default which I would set to UTF-8. See the HTML spec for exact details.

Another option would be to use the default until a UTF-8 character outside the ASCII or iso8859-1 range is detected. Notepad does this somehow, and always correctly detects the files as UTF-8 if they contain a chacter greater then U+007F. It probably detects the control characters (U+0080 to U+009F) or something like that.

Wolfgang Loch

2004-08-19 21:50:44

Re: Is it possible to set a default encoding when opening file?

Please check out SuperEdi 3.3.3
http://www.wolosoft.com/files/SuperEdi-3.3.3.U.exe

The default encoding can be specified in the Options/Unicode dialog page.

Determining the character set using some sophisticated heuristics is probably also a good idea too. Unfortunately It requires to read a part of the file twice: first to detect the codepage, second to convert it to Unicode and fill the text box. I will keep it in mind anyway - maybe I could just parse the first line.

Post a reply to this message: