#37066: p5-shell-parser: sed: RE error: illegal byte sequence ------------------------------+-------------------------------- Reporter: ag@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: mountainlion Port: p5-shell-parser | ------------------------------+-------------------------------- Changes (by ryandesign@…): * cc: jeremyhu@… (added) Comment: Replying to [comment:2 jmr@…]:
Firstly, it should be LC_CTYPE, not LANG;
Oops, I didn't realize that. As these issues have come up, I've been setting LANG in the ports. This has worked, but LANG sets several environment variables in addition to LC_CTYPE. Not sure what adverse implications that might be having.
and secondly, setting it to C will produce incorrect results unless the non-UTF8 characters are confined to comments. You need to use the actual character encoding of the file (or convert it from that to UTF-8 before running sed).
[http://lists.macosforge.org/pipermail/macports- dev/2012-August/019993.html Jeremy Huddleston Sequoia said] using the C locale was fine, and that's what we've been doing for months already, since the release of Mountain Lion, in dozens of ports. If this was wrong, then there's a bit of cleanup to be done. Perhaps a recipe in PortfileRecipes would be good too, in either case. Note that in the case of this specific ticket, we're talking about making a change to the perl5 portgroup, which does not know what encoding the file being changed is using. Or are you proposing that, instead of changing the perl5 portgroup, p5-shell-parser should change the file's encoding before the portgroup's code runs? That could be done. Looks like p5-shell-parser's Makefile is just ISO-8859-1. Maybe we want a proc in base for converting encodings so we don't have to call `iconv` with `system` manually. -- Ticket URL: <https://trac.macports.org/ticket/37066#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS