On Feb 25, 2005, at 10:15 AM, Daniel Macks wrote:

On Fri, Feb 25, 2005 at 08:33:04AM -0500, Daniel Johnson wrote:
Is there a policy about what encoding to use for .info files?

They are supposed to be "plain text files" in the traditional Unix sense. As such, I don't think there's is any issue about encoding. The validator emits a warning if a .info file contains characters not part of the POSIX :ascii: class.

The fink tool (or specifically perl 5.8.x) and online package
database seem to expect Unicode while FinkCommander assumes
MacRoman. There are two files, gtktalog.info and recode.info that
use MacRoman in the Maintainer field.

Yup, 'fink validate' on those files gives:

Warning: "maintainer" contains non-standard characters. (gtktalog.info)
Warning: "maintainer" contains non-standard characters. (recode.info)

Heh. I didn't think to try 'fink validate'. Duh.

Thus they show correctly in FinkCommander but not
anywhere else. If I change those files to UTF-8, "fink info" gives the
correct result. Of course, then FinkCommander is wrong. :) I came
across this issue because I'm working on a Cocoa program that reads
package info from fink, and since Cocoa assumes text is in Unicode, Bad
Things were happening with those two files. As in crashing. I had to
explicitly convert the text from MacRoman first, like FinkCommander
does.

...and that kind of "how do I encode this portably?" weirdness is one of the reasons we want everything in plain-text ASCII. So the proper solution is to not use non-ASCII chars:) I just patched those two .info files in 10.3/unstable.

dan

Plain ASCII works for me. But unless I missed it (which isn't outside the realm of possibility), it's not documented anywhere and probably should be.

Thanks.

--
Daniel Johnson
[EMAIL PROTECTED]
PGP public key: http://homepage.mac.com/danielj7/publickey.txt

Attachment: PGP.sig
Description: This is a digitally signed message part



Reply via email to