CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2009
    Posts
    1

    Question utf-8 and ascii characters and and memory in bytes.

    how many diferent characters does the utf-8 and ascii encoding has. if every character needs 2 bytes of memory how much memory we need to store all the characters of the utf-8 encoding?

  2. #2
    Join Date
    Dec 2008
    Posts
    144

    Re: utf-8 and ascii characters and and memory in bytes.

    I think it might be useful.
    http://en.wikipedia.org/wiki/UTF-8

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: utf-8 and ascii characters and and memory in bytes.

    The ASCII subset of UTF-8 only needs one byte per character. There are 128 characters in that subset.

  4. #4
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: utf-8 and ascii characters and and memory in bytes.

    Number of bytes needed to encode 1 character in UTF-8 vary from 1 to 6. It depends on the characters.

    http://www.codeguru.com/cpp/misc/mis...le.php/c10451/
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  5. #5
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: utf-8 and ascii characters and and memory in bytes.

    The current Unicode character map doesn't specific any mappings large enough to require six bytes in UTF-8. I think the maximum is 4.

Tags for this Thread

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

Featured