Compare commits
2 Commits
1277c605cd
...
9e682e0e95
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e682e0e95 | |||
| 6c4deb2040 |
@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Text;
|
||||
|
||||
namespace AutoRranslateTextToCsv
|
||||
{
|
||||
|
||||
19
Program.cs
19
Program.cs
@ -11,7 +11,7 @@ namespace AutoRranslateTextToCsv
|
||||
const string InDir = "Input";
|
||||
const string OutDir = "Out";
|
||||
const string SrcDataFile = "_TextDictionary.csv";
|
||||
const string Ver = "0.5";
|
||||
const string Ver = "0.8";
|
||||
static Dictionary<string, string> mDictSrcData;
|
||||
static Dictionary<char, char> DictTongJia = new Dictionary<char, char>();
|
||||
static void Main(string[] args)
|
||||
@ -96,12 +96,18 @@ namespace AutoRranslateTextToCsv
|
||||
|
||||
public static bool LoadCsv(string path, out Dictionary<string, string> _dictSrcData)
|
||||
{
|
||||
_dictSrcData = new Dictionary<string, string>();
|
||||
using (StreamReader sr = new StreamReader(path, Encoding.GetEncoding("gb2312")))
|
||||
_dictSrcData = new Dictionary<string, string>();
|
||||
//using (StreamReader sr = new StreamReader(path, Encoding.GetEncoding("gb2312")))
|
||||
using (StreamReader sr = new StreamReader(path, new UTF8Encoding(true)))
|
||||
{
|
||||
|
||||
int linecount = -1;
|
||||
while (!sr.EndOfStream)
|
||||
{
|
||||
linecount++;
|
||||
if (linecount == 45982)
|
||||
{
|
||||
|
||||
}
|
||||
string line = sr.ReadLine();
|
||||
string[] values = line.Split(',');
|
||||
if (values.Length >= 2)
|
||||
@ -166,7 +172,10 @@ namespace AutoRranslateTextToCsv
|
||||
for (int j = 0; j < valueArr.Length; j++)
|
||||
{
|
||||
if (j == 3)
|
||||
newline += EncodingConvert(Encoding.GetEncoding("gb2312"), Encoding.GetEncoding("shift-jis"), Resultline);
|
||||
{
|
||||
//newline += EncodingConvert(Encoding.GetEncoding("gb2312"), Encoding.GetEncoding("shift-jis"), Resultline);
|
||||
newline += EncodingConvert(new UTF8Encoding(true), Encoding.GetEncoding("shift-jis"), Resultline);
|
||||
}
|
||||
else
|
||||
newline += valueArr[j];
|
||||
|
||||
|
||||
369102
_TextDictionary.csv
Normal file
369102
_TextDictionary.csv
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user