perl Encode::_utf8_off in python -


what python's equivalent function of perl's encode::_utf8_off ?

you should never ever use encode::_utf8_off.

you trying encode string using utf-8. in perl, you'd use of following:

  • utf8::encode($s);
  • utf8::encode( $utf8 = $uni );
  • use encode qw( encode_utf8 ); $utf8 = encode_utf8($uni);
  • use encode qw( encode ); $utf8 = encode('utf-8', $uni);

i don't know python, quick search finds

utf8 = uni.encode('utf-8', 'strict') 

Comments

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -