Hello everybody. Is it true that strings are stored in memory in UNICODE format but are converted to ANSI when you save them on disk? Thank you.
Printable View
Hello everybody. Is it true that strings are stored in memory in UNICODE format but are converted to ANSI when you save them on disk? Thank you.
Generally speaking: Yes. If by unicode format, you mean 2 bytes per character. Strings can be written to disc in 2 byte format if desired. FYI: VB controls and unicode do not work well together.
Note: VB really stores strings in memory in what is called a BSTR format. There are plenty of articles describing BSTR and how VB stores/handles strings.
Edited: Here is a great article on CodeGuru regarding VB datatype storage. Took me a bit to locate it; haven't reviewed it in quite a few years.Quote:
What is a BSTR? A bstr is a pointer to a string of wide characters (2 bytes per char). The string is not terminated. Instead, the length of the string is stored as an unsigned long (four bytes) just before the first character of the string.
Moved To General Developer