Yes you are right. after my_msg has been encoded as ascii, it would be ascii.
What I want to check is whether the encoding of my_msg is ascii or not. If yes then go to if else go to part1.

Yes I have to handle the exception part.