[144426] trunk/doc-new/guide/xml/portfile-tcl.xml

Joshua Root jmr at macports.org
Fri Jan 8 14:02:51 PST 2016


> Revision: 144426
>           https://trac.macports.org/changeset/144426
> Author:   dstrubbe at macports.org
> Date:     2016-01-08 12:16:33 -0800 (Fri, 08 Jan 2016)
> Log Message:
> -----------
> doc-new: Add comments on locale in reinplace.
> 
> Modified Paths:
> --------------
>     trunk/doc-new/guide/xml/portfile-tcl.xml
> 
> Modified: trunk/doc-new/guide/xml/portfile-tcl.xml
> ===================================================================
> --- trunk/doc-new/guide/xml/portfile-tcl.xml	2016-01-08 19:39:53 UTC (rev 144425)
> +++ trunk/doc-new/guide/xml/portfile-tcl.xml	2016-01-08 20:16:33 UTC (rev 144426)
> @@ -275,7 +275,9 @@
>                the command with the replacement text, in all files
>                specified.</para>
>  
> -              <para>Use -locale to set the locale</para>
> +              <para>Use -locale to set the locale. For example, <code>locale -C</code>
> +	      if a non-ASCII file is being modified (which may otherwise give the error
> +	      "sed: RE error: illegal byte sequence").</para>

Setting a locale is not needed for all non-ASCII files, just non-UTF-8
ones (as the default locale is "en_US.UTF-8"). It may also be worth
mentioning that using "C" will only allow ASCII characters to be
processed correctly by the reinplace, so if you need it to work on
non-ASCII characters you need to set a locale with the correct charset
for the file, e.g. "en_US.ISO8859-1".

Also, it should be "-locale C" not "locale -C".

- Josh


More information about the macports-dev mailing list