Any Encoding that supports Unicode AND ASCII?

Discussion in 'Programming & Scripting' started by SSM, Aug 3, 2009 with 3 replies and 173 views.

  1. SSM

    SSM Enthusiast

    Messages:
    437
    Ratings:
    122
    I'm rewriting to make a new file, a copier for .map files. In the map files there is Unicode strings and also ASCII, is there a way for me to write the whole thing using an encoding that writes unicode and ASCII? Please respond ASAP...


    EDIT : I already tried all the following :
    ENCODING.UTF32
    ENCODING.UTF8
    ENCODING.UTF7
    ENCODING,ASCII
    ENCODING.UNICODE
    ENCODING.DEFAULT
    ENCODING.BIGENDIANUNICCODE
     
  2. Luxurious Meat

    Luxurious Meat Enthusiast

    Messages:
    615
    Ratings:
    120
    File.Copy("source path", "dest path")
     
    • Like Like x 1
  3. Nothinbeter2do

    Nothinbeter2do Banned

    Messages:
    2,425
    Ratings:
    526
    You could also do

    Code:
    BinaryReader br = new BinaryReader(new FileStream(mapLocation, FileMode.Open)
    byte[] mapData;
    br.BaseStream.Position = 0;
    mapData = br.ReadBytes((int)br.BaseStreamLength));
    br.Close();
    
    BinaryWriter bw = new BinaryWriter(new FileStream(newMapLocation, FileMode.Open)
    bw.BaseStream.Position = 0;
    bw.Write(mapData)
    bw.Flush();
    bw.Close();
    
    It's in C#, but you should be able to convert it.
     
    • Like Like x 1
  4. OP
    SSM

    SSM Enthusiast

    Messages:
    437
    Ratings:
    122
    Thanks you guys! One problem, I have the .map files in the resources...how would I make it copy the file from there to the users computer?
     

Share This Page