<div dir="ltr">Hi, when getting text via the raw_input method it's always a string (even if it contains non-ASCII characters). The problem lies in that whenever I try to check equality against a Unicode string it fails. I've tried using the unicode method to 'cast' the string to the Unicode type but this throws an exception:<br>

<br>>>> a = raw_input("text: ")<br>text: おはよう瘢雹<br>>>> b = u"おはよう瘢雹"<br>>>> a == b<br>__main__:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal<br>

False<br>>>> type(a)<br><type 'str'><br>>>> type(b)<br><type 'unicode'><br>>>> unicode(a)<br>Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)<br>>>> str(b)<br>Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)<br><br><br>After a couple hours of hair pulling I think it's about time to admit defeat. Any help would be appreciated! -Damian<br>

<br></div>