Add encoding option to open4 #27
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there,
We use open4 to generate various images from raw PDF data via an external command which involves a lot of binary data. We ran into issues with string encoding when using open4, so I've added an option to #popen4, #pork4, and #popen4ext.
The change to #popen4ext has re-ordered it's arguments, and I've also changed the *cmd argument to just cmd (removed the splat), but you can still pass an array of command parameters as the first argument.
I realise this changes the public API, but I thought the encoding options might be of interest. Happy to update with suggestions of different ways to set the encoding but maintain the current public API.