D's Auto Decoding and You

Jack Stouffer via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu Jun 2 14:31:39 PDT 2016


On Thursday, 2 June 2016 at 21:21:50 UTC, jmh530 wrote:
> I was a little confused by something in the main autodecoding 
> thread, so I read your article again. Unfortunately, I don't 
> think my confusion is resolved. I was trying one of your 
> examples (full code I used below). You claim it works, but I 
> keep getting assertion failures. I'm just running it with rdmd 
> on Windows 7.
>
>
> import std.algorithm : canFind;
>
> void main()
> {
> 	string s = "cassé";
>
> 	assert(s.canFind!(x => x == 'é'));
> }

Your browser is turning the é in the string into two code points 
via normalization whereas it should be one. Try using \u00E9 
instead.


More information about the Digitalmars-d-announce mailing list