G
Guest
Hello All:
I have a windows application that I need to encode a string using Unicode.
The example I have been given to use is a Web-Version. Below is the webcode.
Response.ContentEncoding=System.Text.Encoding.Unicode;
Response.ContentType = "application/postscript";
Response.Buffer =true;
Response.AppendHeader("Content-Disposition","attachment; filename=\"" +
sFilename + "\"");
Byte[] ba = System.Text.Encoding.Unicode.GetBytes(sPSFile);
Byte[] by = new System.Byte[1];
for(int i=0;i<ba.Length;i+=2)
{
by[0]=ba;
Response.BinaryWrite(by);
}
Response.End();
I am having a hard time converting this code into the windows equivalent so
that the files remain the same. Would anyone be able to help?
I know what I am trying is not working. I thought I had to start down this
path:
Byte[] ba = System.Text.Encoding.Unicode.GetBytes(postScript);
UnicodeEncoding encoding = new UnicodeEncoding();
postScript = encoding.GetString(ba);
But I know the encoding.GetString() simply converts it back to a string.
How do I get the value postScript to be the encoded value?
Thanks
Andy
I have a windows application that I need to encode a string using Unicode.
The example I have been given to use is a Web-Version. Below is the webcode.
Response.ContentEncoding=System.Text.Encoding.Unicode;
Response.ContentType = "application/postscript";
Response.Buffer =true;
Response.AppendHeader("Content-Disposition","attachment; filename=\"" +
sFilename + "\"");
Byte[] ba = System.Text.Encoding.Unicode.GetBytes(sPSFile);
Byte[] by = new System.Byte[1];
for(int i=0;i<ba.Length;i+=2)
{
by[0]=ba;
Response.BinaryWrite(by);
}
Response.End();
I am having a hard time converting this code into the windows equivalent so
that the files remain the same. Would anyone be able to help?
I know what I am trying is not working. I thought I had to start down this
path:
Byte[] ba = System.Text.Encoding.Unicode.GetBytes(postScript);
UnicodeEncoding encoding = new UnicodeEncoding();
postScript = encoding.GetString(ba);
But I know the encoding.GetString() simply converts it back to a string.
How do I get the value postScript to be the encoded value?
Thanks
Andy