encoding - Reading unknown-encoded text files in Adobe AIR -


i've got adobe air app users can process text files filesystems. i've been assuming utf-8, in case text file in other encoding (eg iso-8859-1 or iso-2022-kr), how should determine (best guess) encoding type of text file can read contents string?

filestream.readmultibyte supports an intimidating range of types.

you can try guess looking if file has header, bom. never 100% sure.

look @ answers:

how detect encoding of file?

how can detect encoding/codepage of text file

edit: maybe guessing approach, not in as3 help: simple class automatically detect text file encoding, english-biased "best guess" heuristic based on byte patterns in absence of bom.

also, if option in app, can use utf-8 , let users preview text in encoding of choice.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -