![]() * Copyright Tao Klerks, 2010-2012, Licensed under the modified BSD license: * - CharDet - Mozilla browser's detection routines * - MLang - Microsoft library originally for IE6, available in Windows XP and later APIs now (I think?) * - For more general detection routines, see existing projects / resources: * ranges of the Latin-1 and (particularly) Windows-1252 codepages. ![]() * the presence of UTF-8 encoded accented and other characters found in the upper * - The UTF-8 detection heuristic only works for western text, as it relies on * reliability against performance / memory usage. * are going to read the whole file into memory at some point, then best to pass * heuristic - so the more of the file we can sample the better the guess. ![]() Net, also incorrectly called "ASCII") encodings, we use a * - As there is no "Reliable" way to distinguish between UTF-8 (without BOM) and * encoding, and a "default" (western / ascii-based) encoding alternative provided * aims to differentiate between some of the most common variants of Unicode * - This class does NOT try to detect arbitrary codepages/charsets, it really only * detection library originally developed for Internet Explorer). * - This code is fully managed, no shady calls to MLang (the unmanaged codepage * Simple class to handle text file encoding woes (in a primarily English-speaking tech Public static class TextFileEncodingDetector
0 Comments
Leave a Reply. |