|
-
May 6th, 2009, 09:30 AM
#1
Thread Starter
Addicted Member
storing strings on disk
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.
-
May 6th, 2009, 09:35 AM
#2
Re: storing strings on disk
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.
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.
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.
Last edited by LaVolpe; May 6th, 2009 at 09:56 AM.
-
May 6th, 2009, 11:34 AM
#3
Re: storing strings on disk
Moved To General Developer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|