- if (theBuffer.data()[0u])
- CPPUNIT_ASSERT( strcmp(theBuffer, utf7) == 0 );
-#else //ANSI
- wxString str(utf7);
+void StringTestCase::ConversionUTF7()
+{
+ static const StringConversionData utf7data[] =
+ {
+ { "+-", L"+" },
+ { "+--", L"+-" },
+#if !defined(__GNUC__) || (__GNUC__ >= 3)
+ { "+AKM-", L"\u00a3" },
+#endif
+ // Windows accepts invalid UTF-7 strings and so does our UTF-7
+ // conversion code -- this is wrong IMO but the way it is for now
+ //
+ // notice that converting "+" still behaves as expected because the
+ // result is just an empty string, i.e. the same as if there were an
+ // error, but converting "a+" results in "a" while it really should
+ // fail
+ { "+", NULL },
+ { "a+", L"a" },
+ };