
25 Jun
2010
25 Jun
'10
12:58 p.m.
Joel de Guzman wrote:
Ouch. Just because of that one exceptional case (invalid UTF input at the end of the string.)?
I think either it should be safe to use for any string, or only safe to use for a valid one. No need for any in-between like safe to use for any string except if invalid at the end. That's why my library will provide two variants (safe and unsafe), albeit I haven't done that yet. I wonder however if the "Ouch" is really justified. Surely the fact that iterators are a bit "thick" shouldn't add that much overhead? I really need to benchmark this.