char[] + utf-8 + canFind == bug?

Andrea Fontana advmail at katamail.com
Tue Nov 22 08:28:30 PST 2011


I've some problems (again) with UTF-8. Try this code:

char[] chars = ['à','è','ì'];
chars.canFind('è');

It doesn't work:
std.utf.UTFException at std/utf.d(644): Invalid UTF-8 sequence (at index 1)

But this one works:

string[] chars = ["à","è","ì"];
chars.canFind("è");

I'm using dmd/druntime/phobos downloaded from github today.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20111122/0c21cd32/attachment-0001.html>


More information about the Digitalmars-d mailing list