Fix #1033, Fix #1008, UTF-safe nelle API