2009-02-10から1日間の記事一覧
終わった…あっさりと。文字コードと戯れていたオレってなんだったんだろう。 # coding: utf-8 from codecs import getincrementaldecoder, iterencode def _iter_mbchar(iterator, encoding, errors='strict', **kwargs): decoder = getincrementaldecoder(e…
codecs の Python ソースにこのようなものをみつけた。 def iterdecode(iterator, encoding, errors='strict', **kwargs): """ Decoding iterator. Decodes the input strings from the iterator using a IncrementalDecoder. errors and kwargs are passed …
codecs モジュールには先日までは知らなかった、 IncrementalDecoder により一字ずつデコードする機能があった。これにはまだまだ知らないで損している機能があるような気がして、もうすこしさわってみることにした。まずはコーデックの自作と登録から。それ…