Open dfc opened 10 years ago
Looking at the error, it seems to be an encoding issue.
To confirm again, this is the test file that came with the repo? What does "file test" say?
What happens if you add a "use encoding 'utf8';" right after the line "use GetOpt::Long;" ?
Yes test file from repository. Added encoding does not help. Gives an extra warning:
test file:
(master *):dfc@ronin:~/0xRepos/Writing/Academic-Writing-Check$ md5sum test*
786007dd8085e884e966e726e9451f61 test
b83ef6a5c075ae8078cc88ddd10a0603 test.dh
attempted check:
(master *):dfc@ronin:~/0xRepos/Writing/Academic-Writing-Check$ ./checkwriting test
Use of the encoding pragma is deprecated at ./checkwriting line 12.
Strings with code points over 0xFF may not be mapped into in-memory file handles
Invalid argument at ./checkwriting line 140.
git diff and remotes
(master *):dfc@ronin:~/0xRepos/Writing/Academic-Writing-Check$ git remote -v
origin git@github.com:dfc/Academic-Writing-Check.git (fetch)
origin git@github.com:dfc/Academic-Writing-Check.git (push)
upstream https://github.com/devd/Academic-Writing-Check.git (fetch)
upstream https://github.com/devd/Academic-Writing-Check.git (push)
(master *):dfc@ronin:~/0xRepos/Writing/Academic-Writing-Check$ git diff upstream/master
diff --git a/checkwriting b/checkwriting
index 50dd67f..869eb9b 100755
--- a/checkwriting
+++ b/checkwriting
@@ -9,6 +9,7 @@
use strict ;
use warnings;
use Getopt::Long;
+use encoding 'utf8';
my @switch_list = ('passive','dups','weasel','abbr','typography','strunk','user');
my %options= map {$_=>1} @switch_list;
locale
$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
I just pushed a commit that I believe should fix your bug. Can you try it (on both OSX and Debian) ?
The script does not work on my Debian machine, but it does work with the perl in OSX. When run with a filename as an option I get the following error:
If I pass text in via STDIN it prints the color key but no other output:
perl versions
Debian
OSX Perl