Fixed replacing control characters in multibyte strings