[Mono-list] C# Hexadecimal Escape Char Anomalies???
Gonzalo Paniagua Javier
gonzalo@ximian.com
Mon, 23 Feb 2004 10:32:53 +0100
El lun, 23-02-2004 a las 05:34, Matthew Franz escribió:
> I realize this is a C# issue but can one create "binary strings" in C# using
> string="\xff\x00\x00\xff" used by C/Python?
>
> Why do my 0xff's get translated to 0x3f's???
I get this:
------
gpanjav@lalo4:~/go-mono$ cat bobo.cs
using System;class SimpleTest{ public static void Main(String[]
args) { String bobo = "\xFF\xFF";
System.Console.Write(bobo); }}
gpanjav@lalo4:~/go-mono$ mono bobo.exe | od -x
0000000 ffff
0000002
gpanjav@lalo4:~/go-mono$ cat bobo.cs | indent
using System;
class SimpleTest
{
public static void Main (String[]args)
{
String bobo = "\xFF\xFF";
System.Console.Write (bobo);
}}
gpanjav@lalo4:~/go-mono$ mcs bobo.cs
Compilation succeeded
gpanjav@lalo4:~/go-mono$ mono bobo.exe | od -x
0000000 ffff
0000002
-----
-Gonzalo