[GRASS5] New tcltkmenu

Glynn Clements glynn.clements at virgin.net
Mon Apr 19 07:54:52 EDT 2004


Sjors wrote:

> This didn't work for me. Although I've succesfully installed the package 
> I'm just trying to be precise.
> 
> >The README.txt file appearst to be in "Microsoft Unicode" format:
> >
> >	$ file README.txt
> >	README.txt: Little-endian UTF-16 Unicode English character data, with very long lines
> >
> >It's essentially UTF-16, except with a "byte-order mark" (0xfeff) at
> >the start of the file.
> >
> >You can convert it to ASCII with:
> >
> >	dd if=README.txt bs=2 skip=1 | iconv -f UTF-16 -t US-ASCII
> >
> >  
> >
> I get this error message:
> 
> 1660+0 records in
> 1660+0 records out
> iconv: illegal input sequence at position 0
> 
> I've looked at the manpages of dd and iconv but could not get any wiser. 
> If run with skip=0 the text is printed to standard out, ie in my case my 
> xterm.

Hmm. We appear to be looking at different versions. I was looking at
the tcltkgrass4G57.tar.gz file (82580 bytes), posted to this list on
April 12th. In that, README.txt is 3650 bytes, which equates to 1824
records (not counting the one which is skipped).

That file has a byte-order mark at the beginning of the file:

	$ od -t x1z ~/README.txt | head -n 1
	0000000 fe ff 00 54 00 63 00 6c 00 54 00 6b 00 47 00 52  >...T.c.l.T.k.G.R<

while the remainder of the file is straight UTF-16 text.

iconv will fail if the input contains any characters which can't be
represented in the destination encoding. Try converting to UTF-8
instead, i.e.:

	iconv -f UTF-16 -t UTF-8 README.txt

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list