GregBowyer / cld2-cffi

Python bindings to the Compact Language Detector
Apache License 2.0
33 stars 10 forks source link

Fix untrue doc comment about `utf8Bytes` #22

Closed gthb closed 5 years ago

gthb commented 5 years ago

The actual code has accepted Unicode strings (type str) in Python 3 for a long time. In both Python 2 and 3, utf8Bytes can be of a type named str. In Python 2, that's a byte string type, and the bytes must be UTF-8. In Python 3 it is a Unicode string type, and string will be converted to UTF-8 bytes. In Python 3 the argument can also be of type bytes, which is equivalent to passing a str (byte string) in Python 2, so likewise it must be UTF-8 encoded.

GregBowyer commented 5 years ago

I am ok with this, I dont think it needs a release but that you for the PR