File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,10 @@ private DetectionResult DataEnd()
470470 //TODO why done isn't true?
471471 return new DetectionResult ( new DetectionDetail ( CodepageName . ASCII , 1.0f ) ) ;
472472 }
473+ else if ( InputState == InputState . EscASCII )
474+ {
475+ return new DetectionResult ( new DetectionDetail ( CodepageName . ASCII , 1.0f ) ) ;
476+ }
473477
474478 return new DetectionResult ( ) ;
475479 }
Original file line number Diff line number Diff line change @@ -34,6 +34,19 @@ public void TestAscii()
3434 }
3535 }
3636
37+ [ Test ]
38+ public void TestAscii_with_HZ_sequence ( )
39+ {
40+ const string text = "virtual ~{{NETCLASS_NAME}}();" ;
41+ var stream = AsciiToStream ( text ) ;
42+ using ( stream )
43+ {
44+ var result = CharsetDetector . DetectFromStream ( stream ) ;
45+ Assert . AreEqual ( CodepageName . ASCII , result . Detected . EncodingName ) ;
46+ Assert . AreEqual ( 1.0f , result . Detected . Confidence ) ;
47+ }
48+ }
49+
3750 private static MemoryStream AsciiToStream ( string s )
3851 {
3952 return new MemoryStream ( Encoding . ASCII . GetBytes ( s ) ) ;
You can’t perform that action at this time.
0 commit comments