Results 1 to 3 of 3

Thread: storing strings on disk

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    195

    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.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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
  •  



Click Here to Expand Forum to Full Width