aphtech / send-to-braille

Braille quick translation
Other
3 stars 2 forks source link

Account for different case variations for file extensions when avoiding UTF-8 reencoding. #8

Closed tmthywynn8 closed 6 years ago

tmthywynn8 commented 6 years ago

Why this pull request is needed:

Extensions in mixed or uppercase was not accounted for by the conditional in pull request #7.

What this pull request does:

  1. It accounts for extension case variation, i.e., if it is uppercase, lowercase, or mixed case, thanks to the /I switch of the if conditional.
  2. When copying for UTF-8 reencoding, copies in binary mode instead of ASCII, ensuring a byte-for-byte copy of the file in the %temp% directory.

Tests performed:

  1. Converted a file with a .docx extension, ensuring that the UTF-8 reencoding conditional did not run.
  2. Converted a file with a .DOCX extension, ensuring that the UTF-8 reencoding conditional did not run.
  3. Converted a file with a .DoCX extension, ensuring that the UTF-8 reencoding conditional did not run.