Beispiel #1
0
        public WEMDocument[] ReadDocuments(Stream textStream,
            Encoding outputEncoding)
        {
            EncodingDetector detector
                = new EncodingDetector(Language.SimplifiedChinese);

            Encoding enc = detector.Detect(textStream);

            return ReadDocuments(textStream, outputEncoding, enc);
        }
Beispiel #2
0
        /// <summary>
        /// 从输入流读取字符串,并自动识别和转换字符编码。
        /// </summary>
        /// <param name="inputStream">输入流</param>
        /// <param name="output">输出字符串</param>
        public void Read(Stream inputStream, out string output)
        {
            EncodingDetector detector
                = new EncodingDetector(Language.SimplifiedChinese);

            //获取输入编码。
            Encoding enc = detector.Detect(inputStream);

            //调用重载。
            Read(inputStream, out output, enc);
        }