[Mono-list] C# Hexadecimal Escape Char Anomalies???

Matthew Franz mdfranz@io.com
Sun, 22 Feb 2004 22:34:16 -0600


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???

Thanks

- mdf


=====
using System;

class SimpleTest
{
    public static void Main(String[] args)
    {
        String bobo = "\xFF\xFF";
        System.Console.Write(bobo);
    }
}

bash-2.05a$ mono simple.exe | od -x
0000000 3f3f
0000002

bash-2.05a$ cat pypy
test="\xff\xff\xff\xff"
print test

bash-2.05a$ python pypy | od -h
0000000 ffff ffff 000a
0000005


-- 
| Matthew Franz                              mdfranz@io.com |
|              http://www.io.com/~mdfranz                   |