Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--unicode (-u) and --encoding flags #11

Open
ExpHP opened this issue Feb 15, 2021 · 0 comments
Open

--unicode (-u) and --encoding flags #11

ExpHP opened this issue Feb 15, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@ExpHP
Copy link
Owner

ExpHP commented Feb 15, 2021

The resolution to #2 so far is a bit complete; as of right now, binary files always use Shift-JIS strings, when the intent was to let them use any ASCII-compatible encoding.

I have a git stash where I tried to add these flags, but something bothered me about it: In particular, I was forced to thread a &'static Encoding parameter through many functions in src/formats/{anm,msg,std}.rs.

The most annoying part is the fact that both (de-)compilation (i.e. AnmFile <-> ast::Script) AND file IO (i.e. fn(&AnmFile, &mut BinWrite) functions require the argument:

  • File IO functions require it because types like AnmFile contain Strings.
  • Compilation/decompilation requires it because the current LLIR instr type contains a fully encoded blob of argument bytes

I think it's better to eliminate the first bullet; AnmFile should contain Encoded for its strings. The only annoying part then is that the Meta conversions will require the encoding.

@ExpHP ExpHP added the enhancement New feature or request label Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant