perl - How to detect malformed UTF characters -


i want detect , replace malformed utf-8 characters blank space using perl script while loading data using sql*loader. how can this?

consider python. allows extend codecs user-defined error handlers, can replace undecodable bytes want.

import codecs codecs.register_error('spacer', lambda ex: (u' ', ex.start + 1)) s = 'spam\xb0\xc0eggs\xd0bacon'.decode('utf8', 'spacer') print s.encode('utf8') 

this prints:

spam  eggs bacon 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -