fix for Bug 1374203, Adding defensive code to encode all non ascii chars

Closes-Bug: 1374203

Change-Id: Ifa02e8099a270963bee19d9d5a8a7939502fc32c
Merge "fix for Bug 1374203, Adding defensive code to encode all non ascii chars"