Le 06/10/2015 21:43, Guillaume Munch a écrit :
-    LASSERT(static_cast<unsigned char>(*c) < 0x80, return l);
-    s.push_back(*c);
+    if (static_cast<unsigned char>(*c) < 0x80)
+        s.push_back(*c);
+    else
+        return s += from_utf8(string(c));


In the meanwhile I understood that probably the precision that you need
is that c is a C string that denotes the suffix of r and string(c)
converts the whole remainder of r into a c++ string, not just the next
char.

I would not describe that code as readable ;) This early return in the loop is pretty weird.

OTOH, I am not opposed to extending docstring to understand utf8. At the time where it was introduced, it was decided to stick to ASCII because there was a big risk of passing latin1 strings. We can probably assume that this risk is gone now.

JMarc

Reply via email to