Say I have this function in python, that takes a string and just returns the decode('string-escape') of it:
def myFunc(s):
return s.decode("string-escape")
Is there an equivalent to this in C#? I've tried a few things like encoding the string into UTF-8 and storing it in a byte array, but nothing seems to give me the exact same string that python does.
EDIT: sample python usage:
>>> from base64 import b64encode #import base64 encode
>>> s = "x\340s5g\272m\273\252\252\344\202\312\352\275\205" #original string
>>> decoded = s.decode("string-escape")
>>> print decoded #print decoded string
x?s5g?m?????꽅
>>> print b64encode(decoded)
eOBzNWe6bbuqquSCyuq9hQ== #base 64 encoded version of the end result
So starting with the same string s in C#, how would I be able to get the same base64 encoded version?
If this isn't clear or needs more info please let me know