Clean up utf8ness quote

Move common codes on utf8ness and quote to common/utils.py

Change-Id: I91d98a06fa94ac608119a0d70adedc6d73337c64
Merge "Clean up utf8ness quote"