Use hex representation, double quote slashes in expectation. Do not use print in doctests .
""" >>> s = u"šđčćž" >>> s u'\\xc5\\xa1\\xc4\\x91\\xc4\\x8d\\xc4\\x87\\xc5\\xbe' """