Skip to content

Commit

Permalink
Add ShiftJIS decode/encode support for MoarVM
Browse files Browse the repository at this point in the history
This makes the new shiftjis support in MoarVM accessible. It is
accessible as windows-932 because that is the dialect of shiftjis that
was implemented. It is not listed as shiftjis to maintain forward
compatibility in case other shiftjis (or the original) are added in
later.
  • Loading branch information
samcv committed Mar 26, 2018
1 parent db7361a commit 646f921
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/Encoding/Registry.pm6
Expand Up @@ -19,6 +19,7 @@ my class Encoding::Registry {
'latin1','latin-1','csisolatin1','l1','ibm819','cp819'),
nqp::list('windows-1251', 'windows1251'),
nqp::list('windows-1252', 'windows1252'),
nqp::list('windows-932', 'windows932')
);
my int $i = -1;
my int $elems = nqp::elems($encodings);
Expand Down
3 changes: 3 additions & 0 deletions src/core/Rakudo/Internals.pm6
Expand Up @@ -299,6 +299,9 @@ my class Rakudo::Internals {
# windows-1252
'windows-1252', 'windows-1252',
'windows1252', 'windows-1252',
# ShiftJIS
'windows-932', 'windows-932',
'windows932', 'windows-932',
);
method NORMALIZE_ENCODING(Str:D \encoding) {
my str $key = nqp::unbox_s(encoding);
Expand Down

0 comments on commit 646f921

Please sign in to comment.