YuSong - 2004-08-04

In order to process dir or file which name includes chinese characters. I change ICSharpCode.SharpCvsLib.Streams.ReadLineBlock method to read GB2312 character from stream correctly.

        private string ReadLineBlock() {
            ArrayList buffer = new ArrayList(1024);
            while (true)
            {
                int i = ReadByte();
                if (i == '\n' || i == -1)
                {
                    break;
                }
                buffer.Add((byte)i);
            }
            return EncodingUtil.DEFAULT_ENCODING.GetString((byte[])buffer.ToArray(typeof(byte)));
        }

In order to process encoding correctly, it's important to use SharpCvsLibConfig.Encoding open the text file.
Modification example:

private Hashtable ReadFromFile (String fullPath, Factory.FileType fileType) {
    ...
    sr = File.OpenText(cvsFullPath);
    ...
}

changed to:

private Hashtable ReadFromFile (String fullPath, Factory.FileType fileType) {
    ...
    sr = new StreamReader(File.OpenRead(cvsFullPath), SharpCvsLibConfig.Encoding);
    ...
}

please search all File.OpenRead or File.OpenText which invoked irrelevantly, and modify them.

In order to process GB2312 encoding, you also need to change ICSharpCode.SharpCvsLib.Config.SharpCvsLibConfig.DEFAULT_ENCODING to Encoding.GetEncoding("GB2312") like this:
    public static Encoding DEFAULT_ENCODING = Encoding.GetEncoding("GB2312");

Now it can support chinese characters correctly.