[IronPython] codecs module in Silverlight

Michael Foord fuzzyman at voidspace.org.uk
Tue Dec 15 02:03:41 PST 2009


On 15/12/2009 00:55, Lukas Cenovsky wrote:
> Hi all,
> I cannot import codecs module in Silverligh IronPython - it throws 
> NameError for lookup_error method. The reason is this method is not in 
> the _codecs module of Silverlight IronPython:
>

Yeah, this is a problem that prevents you using simplejson in 
Silverlight as well. :-(

Michael

> dir(_codecs) - Silverlight
> ['__doc__', '__name__', '__package__', 'ascii_decode', 'ascii_encode',
> 'charbuffer_encode', 'charmap_decode', 'charmap_encode', 'decode', 
> 'encode',
> 'escape_decode', 'escape_encode', 'lookup', 'raw_unicode_escape_decode',
> 'raw_unicode_escape_encode', 'readbuffer_encode', 'register',
> 'unicode_escape_decode', 'unicode_escape_encode', 
> 'unicode_internal_decode',
> 'unicode_internal_encode', 'utf_16_be_decode', 'utf_16_be_encode',
> 'utf_16_decode', 'utf_16_encode', 'utf_16_ex_decode', 'utf_16_le_decode',
> 'utf_16_le_encode', 'utf_8_decode', 'utf_8_encode']
>
> dir(_codecs) - IronPython
> ['__doc__', '__name__', '__package__', 'ascii_decode', 'ascii_encode',
> 'charbuffer_encode', 'charmap_decode', 'charmap_encode', 'decode', 
> 'encode',
> 'escape_decode', 'escape_encode', 'latin_1_decode', 'latin_1_encode', 
> 'lookup',
> 'lookup_error', 'mbcs_decode', 'mbcs_encode', 
> 'raw_unicode_escape_decode',
> 'raw_unicode_escape_encode', 'readbuffer_encode', 'register', 
> 'register_error',
> 'unicode_escape_decode', 'unicode_escape_encode', 
> 'unicode_internal_decode',
> 'unicode_internal_encode', 'utf_16_be_decode', 'utf_16_be_encode',
> 'utf_16_decode', 'utf_16_encode', 'utf_16_ex_decode', 'utf_16_le_decode',
> 'utf_16_le_encode', 'utf_32_decode', 'utf_32_encode', 'utf_32_ex_decode',
> 'utf_32_le_decode', 'utf_32_le_encode', 'utf_7_decode', 'utf_7_encode',
> 'utf_8_decode', 'utf_8_encode']
>
> Any idea how to make it work? Thanks.
>
> -- 
> -- Lukáš
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog




More information about the Users mailing list