Sign In
Funny, It Worked Last Time
... and other odd mutterings of a performance junkie
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Email Blog Author
RSS for posts
Atom
RSS for comments
OK
Search
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Tags
C++
I18N
Performance
Archive
Archives
June 2005
(1)
May 2005
(2)
January 2005
(2)
November 2004
(1)
October 2004
(5)
November, 2004
MSDN Blogs
>
Funny, It Worked Last Time
>
November, 2004
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Funny, It Worked Last Time
Encodings in Strings are Evil Things (Part 6)
Posted
over 8 years ago
by
ryanmy
0
Comments
How do you define operator[] for a string that's in a variable-width encoding such as UTF-8? One of the basic assumptions in std::string that I intend to honor is that operator[] returns a reference to the actual data, not a copy. For fixed-width encodings such as ASCII, UCS2, or UCS4, this is not a problem; I simply return a unsigned char/short/long. However, for variable-width encodings, I need to return a range of bytes, and presumably a size as well. I could do this with covariant return...
Page 1 of 1 (1 items)