Consolidated _WriteEncodedString*

Performance difference is negligible, and much easier to maintain.