[Mono-list] Re: Does Mono print a leading space?
Gaute B Strokkenes
biggaute@uwc.net
Sun, 07 Sep 2003 21:22:37 +0100
On 7 sep 2003, chris@chrisseaton.com wrote:
> Does Mono (but not Mint) print a leading space whenever it runs a
> program? Running with mono I get
>
> [me@comp dir]$ mono foo
> bar
> [me@comp dir]
>
> But with mint I get
>
> [me@comp dir]$ mint foo
> bar
> [me@comp dir]
>
> MCS also prints this leading space when reporting an error or
> warning.
Mono spits out the bytes BB EF 48 (aka the infamous UTF-8 BOM) before
printing any output when run in a UTF-8 locale, for some unknown
reason. Quoth the Linux Unicode FAQ at
http://www.cl.cam.ac.uk/~mgk25/unicode.html#linux :
One influential non-POSIX PC operating system vendor (whom we shall
leave unnamed here) suggested that all Unicode files should start
with the character ZERO WIDTH NOBREAK SPACE (U+FEFF), which is in
this role also referred to as the "signature" or "byte-order mark
(BOM)", in order to identify the encoding and byte-order used in a
file. Linux/Unix does not use any BOMs and signatures. They would
break far too many existing ASCII-file syntax conventions. On POSIX
systems, the selected locale identifies already the encoding
expected in all input and output files of a process. It has also
been suggested to call UTF-8 files without a signature "UTF-8N"
files, but this non-standard term is usually not used in the POSIX
world.
Hopefully this will be fixed soon.
gs234@belldandy:~$ cat test.cs
class Test
{
static void Main ()
{
System.Console.WriteLine ("Hello World!");
}
}
gs234@belldandy:~$ mono test.exe | od -h
0000000 bbef 48bf 6c65 6f6c 5720 726f 646c 0a21
0000020
gs234@belldandy:~$
--
Gaute Strokkenes http://www.srcf.ucam.org/~gs234/
OKAY!! Turn on the sound ONLY for TRYNEL CARPETING,
FULLY-EQUIPPED R.V.'S and FLOATATION SYSTEMS!!