From b729ee46ebf139399f695c2443cc5a6fdbcbdbe2 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 31 Aug 2024 01:23:49 +0200 Subject: Codepage guessing is done in .teco_ini (refs #5) * There isn't much we can do anyway. We can detect if it's Unicode and otherwise default to _some_ codepage. However, we do not even known which codepage should be preferred. * This is actually trivial to implement in pure SciTECO. Having it in the profile gives you the ability to customize the default non-UTF code page. E.g. if you are working a lot with KOI-8 documents, you could change <1EE> to <204EE>. * Since the Unicode validity check is a noticable slowdown, we limit it to the first 1024 bytes. This speeds up startup significantly compared to checking all codepoints in every document. --- sample.teco_ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sample.teco_ini b/sample.teco_ini index 1c7e521..a352f3e 100644 --- a/sample.teco_ini +++ b/sample.teco_ini @@ -16,6 +16,9 @@ EMQ[$SCITECOPATH]/session.tes :Q*+1Oedit 32,0ED + !* non-UTF-8 documents are assumed to be in latin1 (8859-1) *! + 1024<:C; -A"T 1EE 1;'> J + M[lexer.auto] ! Set up margins ! -- cgit v1.2.3