From f1ee4a4b86df795b3594eff8153948935c5a13d8 Mon Sep 17 00:00:00 2001 From: Haoyu Bai Date: Fri, 10 Jul 2009 17:35:29 +0000 Subject: [PATCH] fix str.cpp for str test case [SVN r54867] --- test/str.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/str.cpp b/test/str.cpp index 98e3cc26..0505b250 100644 --- a/test/str.cpp +++ b/test/str.cpp @@ -26,8 +26,13 @@ void work_with_string(object print) print(data.capitalize()); print('[' + data.center(30) + ']'); print(data.count("t")); +#if PY_VERSION_HEX < 0x03000000 print(data.encode("utf-8")); print(data.decode("utf-8")); +#else + print(data.encode("utf-8").attr("decode")("utf-8")); + print(data.encode("utf-8").attr("decode")("utf-8")); +#endif BOOST_ASSERT(!data.endswith("xx")); BOOST_ASSERT(!data.startswith("test"));