yowsup icon indicating copy to clipboard operation
yowsup copied to clipboard

Can't print the correct character in console

Open lcmeyer37 opened this issue 11 years ago • 1 comments

Hey people, it's odd. But, when I write a message with special characters like á or Â, it doesn't print on my console well. Like, I know it is possible to print them because I did a test on the same program just creating a string with special characters and printing it. But, I can't do it when I try printing the message received by messageProtocolEntity.getBody(), am I getting the encoding wrong or something?

Example of piece of program running below:

Implicit declaration of parallel layers in a tuple is deprecated, pass a YowParallelLayer instead i printed this on console: áàéèúùâêóÂÊÔÛ (<- this proves it can print special chars on console) Message received: Dis dodo dis si olá (<- it should be saying "Dis dodo dis si olá")

what am I doing wrong?

Thanks,

Lucas Meyer.

lcmeyer37 avatar Apr 30 '15 19:04 lcmeyer37

For Python 3.0+: messageProtocolEntity.getBody().encode('latin-1').decode()

lcmeyer37 avatar May 01 '15 00:05 lcmeyer37