make khtml/misc/decoder.* public

Maksim Orlovich mo85 at cornell.edu
Mon Mar 5 18:42:17 GMT 2007


> Allan Sandfeld Jensen wrote:
>>Safe encoding detection:
>>* Look for Unicode BOMs
>
> This is the only safe encoding detection that I know of. Everything else
> is speculative.

Depends on your notion of safety, though. For a lot of codecs, while you
can not detect them reliably, picking them will do no harm, as they're
completely, 100% reversible --- when you convert to unicode and back, you
get the original input back.  In contrast, detecting utf8 from BOM -is-
technically unsafe, since if the BOM-looking sequence is an accident, and
the rest of file is malformed, it's big trouble..







More information about the kde-core-devel mailing list