D6756: rust-utils: add normalize_case util to mirror Python one

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Sat Aug 31 23:02:42 EDT 2019


yuja added a comment.


  > +/// TODO improve handling of utf8 file names. Our overall strategy for
  > +/// filenames has to be revisited anyway, since Windows is UTF-16.
  > +pub fn normalize_case(bytes: &[u8]) -> Vec<u8> {
  > +    #[cfg(windows)] // NTFS compares via upper()
  > +    return bytes.to_ascii_uppercase();
  > +    #[cfg(unix)]
  > +    bytes.to_ascii_lowercase()
  > +}
  
  HFS+ has more complex rules, and some were the source of security issue.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6756/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6756

To: Alphare, #hg-reviewers, kevincox
Cc: yuja, durin42, kevincox, mercurial-devel


More information about the Mercurial-devel mailing list