Re: Encodings

From: vais <>
Date: Thu, 26 Feb 2009 21:28:19 -0800 (PST)

Mitchell, this is just a proof of concept. I imagine you would call it
from the open_helper function, right after you check to see whether
the text is binary (contains null char) and set the buffer's encoding

I think that at least reading the BOM is a good start and gets us
parity with Scite. It is the good ole 80/20 rule, right - reading the
BOM gets results with minimal effort. Heuristical analysis of text to
determine encoding is a whole different beast that I personally have
no interest in - I never had any problems with Scite's encoding
detection, and if TA does the same, I am happy.


On Feb 26, 8:52 pm, mitchell <> wrote:
> Vais,
> > Without further ado, here is a very lame Lua implementation of Unicode
> > encoding detection for textadept that actually gets the job done (I
> > put it into file_io.lua and call it from open_helper, right after the
> > null byte detection routine used to detect binary files):
> > <snip>
> Forgive me, but how do you use this function? Or is it just a proof of
> concept in detecting encoding?
Received on Fri 27 Feb 2009 - 00:28:19 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:37:35 EST