2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-27 07:02:15 +00:00

fix str.cpp for str test case

[SVN r54867]
This commit is contained in:
Haoyu Bai
2009-07-10 17:35:29 +00:00
parent b4dbda873a
commit f1ee4a4b86

View File

@@ -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"));