[2.0] Fix truncated user-agent when App name included non-ASCII characters.

Same as #1195 for 2.0