On Jun 13, 2:36 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
For a database, why would you want to know how many bytes are in a
string? If anything, you should be doing this on a character basis. I
can't imagine a database that doesn't support unicode characters, which is
what .NET natively stores its strings as.
That doesn't mean it's the native storage of the database though. I
remember when I was coding against a Postgres database, it stored
character data in UTF-8 by default (on the platform I was running on).
Now an index could only take something like 2783 bytes per row, so I
had to truncate the string I was using to take only about 2700 bytes
*in UTF-8* without chopping it half way through a character or
anything like that.
Most amusing.
Jon