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

Use more appropriate types for cross-platform unicode support #19

Merged
merged 7 commits into from
Jan 17, 2020

Commits on Dec 18, 2019

  1. Configuration menu
    Copy the full SHA
    97c6ba1 View commit details
    Browse the repository at this point in the history
  2. Fix failing test

    list_missing_volumes fails on Windows, because it expects '/' as the path
    separator.
    vjoki committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    924418f View commit details
    Browse the repository at this point in the history
  3. Add unicode test

    vjoki committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    463b0bb View commit details
    Browse the repository at this point in the history
  4. Rework strings to utilize wchar and the W/Ex API

    Switch over to widestring and W/Ex variants of the unrar_sys functions
    everywhere, fixing unicode issues at the cost of using u16/u32
    instead of u8 types for strings. Though these are what the underlying
    unrar library is also using.
    
    Changed the public Archive API:
    - More permissive with the types accepted for archive filename,
      destination and password.
    - Return PathBufs rather than Strings when representing filenames.
    
    Also tried to avoid taking ownership of filename inside Archive. But
    despite the efforts, all the input strings/paths still end up getting
    copied in the conversion to (Wide)CString.
    
    Passwords are still Strings, as the old RARSetPassword interface only
    supports char. It will be necessary to switch to using
    UCM_NEEDPASSWORDW first. Apparently this is also required for archives
    with encrypted headers.
    
    Fixes muja#11, and partially addresses muja#4.
    vjoki committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    847f9c5 View commit details
    Browse the repository at this point in the history
  5. Update tests and examples

    vjoki committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    79822f9 View commit details
    Browse the repository at this point in the history

Commits on Dec 27, 2019

  1. Configuration menu
    Copy the full SHA
    a856bac View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2020

  1. Try to fail earlier on nul values

    - Add NulError, so that we can combine ffi::NulError and widestring::NulError.
    - Check filename and password for nul values on Archive creation.
    vjoki committed Jan 17, 2020
    Configuration menu
    Copy the full SHA
    2d6b882 View commit details
    Browse the repository at this point in the history