Relaxing the definition of isSomeString and isNarrowString

Andrew Godfrey via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 25 07:19:31 PDT 2014


On Monday, 25 August 2014 at 08:07:58 UTC, Marc Schütz wrote:
> On Sunday, 24 August 2014 at 18:43:36 UTC, Dmitry Olshansky 
> wrote:
>> 24-Aug-2014 22:19, Andrew Godfrey пишет:
>>> The OP and the question of auto-decoding share the same root 
>>> problem:
>>> Even though D does a lot better with UTF than other languages 
>>> I've used,
>>> it still confuses characters with code points somewhat. 
>>> "Element type is
>>> some character" is an example from OP. So clarify for me:
>>> If a programmer makes an array of either 'char' or 'wchar', 
>>> does that
>>> always, unambiguously, mean a UTF8 or UTF16 code point?
>>
>> Yes, pedantically - UTF-8 and UTF-16 code _units_. dchar is a 
>> codepoint.
>
> Right, not just pedantically, but crucially - didn't read it 
> correctly.

Oops, I did it myself. I meant code unit.

Anyway, see my earlier reply - I wasn't asking what the language 
spec says. I'm asking about the reality given what happens when D 
code interfaces with e.g. C/C++ code.


More information about the Digitalmars-d mailing list