Added new fallback to encoding (to avoid overflow in char buffer)