Skip to content

Commit e9bf42b

Browse files
committed
Fixed encoding (now UTF-8) in Parser.cs and RTFNodeGroup.cs so that compilation errors are fixed
1 parent 20b153a commit e9bf42b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Source/Source/Parser.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public bool Accept(RTFToken token , RTFReader reader )
7575
&& reader.LastToken.Key == "u"
7676
&& reader.LastToken.HasParam)
7777
{
78-
// 紧跟在在“\uN”后面的问号忽略掉
78+
// 紧跟在在“\uN”后面的问号忽略掉
7979
if (token.Key.Length > 0)
8080
{
8181
CheckBuffer();
@@ -87,7 +87,7 @@ public bool Accept(RTFToken token , RTFReader reader )
8787
}
8888
//else if (token.Key == "\"")
8989
//{
90-
// // 双引号开头,一直读取内容到双引号结束
90+
// // 双引号开头,一直读取内容到双引号结束
9191
// CheckBuffer();
9292
// while (true)
9393
// {
@@ -128,7 +128,7 @@ public bool Accept(RTFToken token , RTFReader reader )
128128
{
129129
// Unicode char
130130
CheckBuffer();
131-
// 不忽略 \u 指令
131+
// 不忽略 \u 指令
132132
myStr.Append( (char)token.Param);
133133
reader.CurrentLayerInfo.UCValueCount = reader.CurrentLayerInfo.UCValue;
134134
return true;
@@ -142,12 +142,12 @@ public bool Accept(RTFToken token , RTFReader reader )
142142
if ( token.Key == "emdash")
143143
{
144144
CheckBuffer();
145-
myStr.Append("—"); // TODO: Check this literal
145+
myStr.Append('—');
146146
return true;
147147
}
148148
if ( token.Key == "")
149149
{
150-
// 提示未识别的字符
150+
// 提示未识别的字符
151151
CheckBuffer();
152152
myStr.Append('-');
153153
return true;
@@ -652,19 +652,19 @@ public RTFToken NextToken( )
652652
c = myReader.Read();
653653
if (c == '\"')
654654
{
655-
// 以双引号开头,读取连续的字符
655+
// 以双引号开头,读取连续的字符
656656
System.Text.StringBuilder str = new System.Text.StringBuilder();
657657
while (true)
658658
{
659659
c = myReader.Read();
660660
if (c < 0)
661661
{
662-
// 读取结束
662+
// 读取结束
663663
break;
664664
}
665665
if (c == '\"')
666666
{
667-
// 读取结束
667+
// 读取结束
668668
break;
669669
}
670670
else

Source/Source/RTFNodeGroup.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,16 @@ internal void MergeText()
173173
AddString( myStr , buffer );
174174
// notice!! This code may cause compiler error in OS which not support chinese character.
175175
// you can change to myStr.Append('-');
176-
myStr.Append( "¡ª"); // TODO: Check this literal
177-
continue ;
176+
myStr.Append( 'j');
177+
continue ;
178178
}
179179
if( node.Keyword == "" )
180180
{
181181
AddString( myStr , buffer );
182182
// notice!! This code may cause compiler error in OS which not support chinese character.
183183
// you can change to myStr.Append('-');
184-
myStr.Append( "¨C" ); // TODO: Check this literal
185-
continue ;
184+
myStr.Append( 'Ƀ' );
185+
continue ;
186186
}
187187
}
188188
AddString( myStr , buffer );

0 commit comments

Comments
 (0)