Re: specify charset for commits
- From
Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>
- Date
- Dec 22, 2006, 22:02 UTC
- Message-ID
- <20061222220204.GA2407@cepheus>
- In-Reply-To
- <20061222150948.GA6005@cepheus>
Hello,
Uwe Kleine-König wrote:
Show 26 quoted lines
> def is_utf8_str(s): > cnt_furtherbytes = 0 > for c in s: > if cnt_furtherbytes > 0: > if ord(c) & 0xc0 == 0x80: > cnt_furtherbytes -= 1 > else: > return False > else: > if ord(c) < 0x80: > continue > elif ord(c) < 0xc0: > return False > elif ord(c) < 0xe0: > cnt_furtherbytes = 1 > elif ord(c) < 0xf0: > cnt_furtherbytes = 2 > elif ord(c) < 0xf8: > cnt_furtherbytes = 3 > elif ord(c) < 0xfc: > cnt_furtherbytes = 4 > elif ord(c) < 0xfe: > cnt_furtherbytes = 5 > else: > return False > return True
While I washed the dishes I noticed that the last "return True" should be "return cnt_furtherbytes == 0". Just before someone else corrects me ... :-)
Best regards Uwe
-- Uwe Kleine-König http://www.google.com/search?q=parsec%5E2*Joule%2FNewton+in+tablespoon