0.8
This commit is contained in:
parent
1277c605cd
commit
6c4deb2040
@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System.Text;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace AutoRranslateTextToCsv
|
namespace AutoRranslateTextToCsv
|
||||||
{
|
{
|
||||||
|
|||||||
19
Program.cs
19
Program.cs
@ -11,7 +11,7 @@ namespace AutoRranslateTextToCsv
|
|||||||
const string InDir = "Input";
|
const string InDir = "Input";
|
||||||
const string OutDir = "Out";
|
const string OutDir = "Out";
|
||||||
const string SrcDataFile = "_TextDictionary.csv";
|
const string SrcDataFile = "_TextDictionary.csv";
|
||||||
const string Ver = "0.5";
|
const string Ver = "0.8";
|
||||||
static Dictionary<string, string> mDictSrcData;
|
static Dictionary<string, string> mDictSrcData;
|
||||||
static Dictionary<char, char> DictTongJia = new Dictionary<char, char>();
|
static Dictionary<char, char> DictTongJia = new Dictionary<char, char>();
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
@ -96,12 +96,18 @@ namespace AutoRranslateTextToCsv
|
|||||||
|
|
||||||
public static bool LoadCsv(string path, out Dictionary<string, string> _dictSrcData)
|
public static bool LoadCsv(string path, out Dictionary<string, string> _dictSrcData)
|
||||||
{
|
{
|
||||||
_dictSrcData = new Dictionary<string, string>();
|
_dictSrcData = new Dictionary<string, string>();
|
||||||
using (StreamReader sr = new StreamReader(path, Encoding.GetEncoding("gb2312")))
|
//using (StreamReader sr = new StreamReader(path, Encoding.GetEncoding("gb2312")))
|
||||||
|
using (StreamReader sr = new StreamReader(path, new UTF8Encoding(true)))
|
||||||
{
|
{
|
||||||
|
int linecount = -1;
|
||||||
while (!sr.EndOfStream)
|
while (!sr.EndOfStream)
|
||||||
{
|
{
|
||||||
|
linecount++;
|
||||||
|
if (linecount == 45982)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
string line = sr.ReadLine();
|
string line = sr.ReadLine();
|
||||||
string[] values = line.Split(',');
|
string[] values = line.Split(',');
|
||||||
if (values.Length >= 2)
|
if (values.Length >= 2)
|
||||||
@ -166,7 +172,10 @@ namespace AutoRranslateTextToCsv
|
|||||||
for (int j = 0; j < valueArr.Length; j++)
|
for (int j = 0; j < valueArr.Length; j++)
|
||||||
{
|
{
|
||||||
if (j == 3)
|
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
|
else
|
||||||
newline += valueArr[j];
|
newline += valueArr[j];
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user