Utf 8 - Fixes

Applied some UTF-8 related fixes

Please apply to master as well.

Thank you.