[Issue 10668] Unicode characters, when taken from strings (as char), are not printed correctly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 19 08:41:50 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10668



--- Comment #6 from monarchdodra at gmail.com 2013-07-19 08:41:49 PDT ---
(In reply to comment #4)
> Thanks for the response! Yeah, I converted my project to use dstrings on the
> off chance it worked after posting, lo-behold this is the fix it seems.
> 
> I plan on eventually getting the book, although I've read some bad reviews
> regarding the e-book/kindle version, so I'm having to wait a little longer to
> get a hard copy.

I'd recommend trying to get your project to work with "normal UTF8" strings.
They're the norm in D, and you'll have to get around to understanding how they
work sooner or later.

To make it *really* simple, a UTF-8 string should be handled like a
bidirectional range of dchars. You can ask for front/back, popFront/popBack,
and empty. Stick to only these primitives, and your code is *guaranteed* to
work.

All the other primitives (length, index, slice), while *present* require much
more knowledge of what is going on, and should be used only when you *know*
what you are doing. As a matter of fact, if you ask a string if it supports,
say length: "hasLength!string": it will say "false".

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list