On Thursday, 18 September 2014 at 16:51:06 UTC, ketmar via Digitalmars-d-learn wrote:
On Thu, 18 Sep 2014 16:31:08 +0000
Ilya Yaroshenko via Digitalmars-d-learn
<digitalmars-d-learn@puremagic.com> wrote:

"one ring to rule them all"
UTF-8 = Lord of the encodings.
i want 42th symbol from the string. what? what do you mean saying that i must scan the whole string from the beginning to get it? oh, High
Lord, this one Lord is fake!

That's why a while ago I was considering convert a string from UTF-8 to UTF-32. UTF-32 is nice I don't understand when people say there are no any advantage to use it. Indexing is just possible. Memory size isn't much an issue.

I needed to extend support for UTF-8 in a program where I had some routines where I could move forward and backward very easily just indexing but using UTF-8 it isn't possible so I needed to make my own an iterator when I need to save a pointer instead of a index. In memory usage it isn't so bad since a size of that index is same as pointer but the structure of the program was a bit "ugly", a kind of "hack", IMHO.

Reply via email to