How to get the size of a string?
<p>I have a TCP client server communication. I'm sending string, and I would like to measure the size of the package, How can I do that? </p>

<p>In my case the <a href="http://docs.python.org/2/library/sys.html#sys.getsizeof" rel="nofollow">sys.getsizeof</a> is not good because </p>

<pre><code>getsizeof() calls the object’s __sizeof__ method and adds an additional garbage collector
overhead if the object is managed by the garbage collector.
</code></pre>

<p>What is the size of one character, 2 or 4 byte? In this case I can simply measure as <code>msg_size = x * len(msg)</code>, but I don't know how many byte is <code>x</code></p>
