C#: Fast way to check how many UTF-8 encoded bytes thats in a StringBuffer?
<p>I'm building sitemaps and I need a way to quickly check how many UTF-8 encoded bbytes StringBuilder currently contains?</p>

<p>The naive way to do this would be to:</p>

<pre><code>Encoding.UTF8.GetBytes(builder.ToString()).Length
</code></pre>

<p>But isn't this a bit bloated?</p>

<p>Using builder.Length doesn't work as certain charactes resolved to 2 bytes such as ÅÄÖ.</p>
