RFC Allow optional strict decoding of windows-1251/1252 (new ops) #798
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.
This is an RFC for comment on these changes. The op names need to be
changed, so name suggestions are appreciated. Also I would like comment
on whether I should just change the arguments for any function which
is not used in a MoarVM OP, instead of having redundant functions,
would be appreciated.
We have new versions of
encode
,decode
, andencoderep
that allowthe new config flag.
decoderep
never existed before, so this featurewas added to the decoder functions and a function to decode supporting
replacements and a flag was added (
decode2rep
)Flags for these op currently have only one setting:
Config flag 1:
other encoding.
replacements to be done with codepoints that may fit into the target
encoding but are invalid (i.e. 129 in windows-1252).
This adds new ops (names will likely be changed)
decode2rep
: we never had adecoderep
op. This op replaces decodedcharacters that don't have official mappings with a supplied
replacement string. Currently it is limited to replacement of strings
with only one grapheme.
encode2
: likeencode
except you can set an additional config flagdecode2
: likedecode
except you can set an additional config flagencoderep2
: likeencoderep
except you can set an additional configflag