fix encoding for external pipe usage