[Python-ideas] isascii()/islatin1()/isbmp() (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Sat Jun 30 18:14:23 CEST 2012
- Previous message: [Python-ideas] isascii()/islatin1()/isbmp()
- Next message: [Python-ideas] isascii()/islatin1()/isbmp()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sun, Jul 1, 2012 at 2:03 AM, Serhiy Storchaka <storchaka at 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 at gmail.com | Brisbane, Australia
- Previous message: [Python-ideas] isascii()/islatin1()/isbmp()
- Next message: [Python-ideas] isascii()/islatin1()/isbmp()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]