Well, actually, we should use bytes instead of string everywhere ... but this would be slow, and we want to take advantage of .NET String ... by using PhpBytes here, you are causing a lot of copying and encoding from String to PhpBytes (slow) ... all the issues have to be fixed using valid configuration (PageEncoding etc.), not by downgrading to byte arrays.

Your sample should work ok with .NET string.