Avoid empty string for encoding