
June 30, 2012
9:14 a.m.
On Sun, Jul 1, 2012 at 2:03 AM, Serhiy Storchaka <storchaka@gmail.com> wrote:
As shown in issue #15016 [1], there is a use cases when it is useful to determine that string can be encoded in ASCII or Latin1. In working with Tk or Windows console applications can be useful to determine that string can be encoded in UCS2. C API provides interface for this, but at Python level it is not available.
I propose to add to strings class new methods: isascii(), islatin1() and isbmp() (in addition to such methods as isalpha() or isdigit()). The implementation will be trivial.
Why not just expose max_code_point directly instead of adding three new methods? Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia