Subject: bin/19487: file is ignoring UTF16 endianness
To: None <gnats-bugs@gnats.netbsd.org>
From: None <is@beverly.kleinbus.org>
List: netbsd-bugs
Date: 12/21/2002 23:24:27
>Number: 19487
>Category: bin
>Synopsis: file is ignoring UTF-16 endianness
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Dec 21 14:25:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Ignatios Souvatzis
>Release: NetBSD 1.6_STABLE
>Organization:
seal your e-mail: http://www.gnupg.org/
>Environment:
System: NetBSD marie 1.6_STABLE NetBSD 1.6_STABLE (MARIE) #4: Sun Dec 1 21:56:37 CET 2002 is@marie:/var/tmp/MARIE shark
Architecture: arm
Machine: shark
>Description:
file ~/ncoas* creates this output:
/usr/home/is/ncoas.txt: Little-endian UTF-16 Unicode character data, with very long lines, with CRLF line terminators
/usr/home/is/ncoasb.txt: Big-endian UTF-16 Unicode character data, with very long lines, with CRLF line terminators
where ncoasb.txt was created by this command line
dd conv=swab < ncoas.txt > ncoasb.txt
>How-To-Repeat:
Create a UTF-16 text file, say ncoas.txt
dd conv=swab < ncoas.txt > ncoasb.txt
file ncoas*.txt
>Fix:
Index: ascmagic.c
===================================================================
RCS file: /cvsroot/src/usr.bin/file/ascmagic.c,v
retrieving revision 1.17
diff -u -r1.17 ascmagic.c
--- ascmagic.c 2001/09/09 10:46:36 1.17
+++ ascmagic.c 2002/12/21 22:10:47
@@ -600,7 +600,7 @@
return 0;
}
- return 1;
+ return (1+bigend);
}
#undef F
>Release-Note:
>Audit-Trail:
>Unformatted: