Merge pull request #2903 from krytarowski/netbsd-support-4
[mono.git] / mcs / class / I18N / West / Test / I18N.West.Test.cs
index 74a9e22f3ee1faa4a821ffdefa7eacc29863bcee..4b735c50f9a30e46da0c7deb848a9fa64c32a5ed 100644 (file)
@@ -233,5 +233,26 @@ namespace MonoTests.I18N.West
                {
                        AssertDecode ("Test/texts/latin-utf8.txt", "Test/texts/latin-28605.txt", 28605);
                }
+
+               [Test]
+               public void Bug79951 ()
+               {
+                       byte [] expected = new byte [] {0x71, 0x77, 0x65, 0x65, 0x72, 0x74, 0x79, 0x75, 0x69, 0x6F, 0xA2, 0x70, 0x61, 0x61, 0x73, 0x73, 0x64, 0x66, 0x67, 0x68, 0x6A, 0x6B, 0x6C, 0x6C, 0x7A, 0x7A, 0x78, 0x7A, 0x63, 0x63, 0x76, 0x62, 0x6E, 0x6E, 0x6D};
+                       string l = "qwe\u0119rtyuio\xF3pa\u0105s\u015Bdfghjkl\u0142z\u017Cx\u017Ac\u0107vbn\u0144m";
+                       Encoding e437 = Encoding.GetEncoding (437);
+                       byte [] actual = e437.GetBytes (l);
+                       Assert.AreEqual (expected, actual);
+               }
+
+               [Test]
+               public void Bug408381 ()
+               {
+                       byte [] expected = new byte [] {0x27, 0x3F, 0x27};
+                       byte [] utf8bytes = new byte [] {0x27, 0xC2, 0x92, 0x27};
+                       string strToEncode = Encoding.UTF8.GetString(utf8bytes);
+                       Encoding cp1252 = Encoding.GetEncoding (1252);
+                       byte [] actual = cp1252.GetBytes (strToEncode);
+                       Assert.AreEqual (expected, actual);
+               }
        }
 }