Hi All,
I am trying to compress the string & pass it to the next page using query string. the string can contain the special characters like [ À Á Â Ã Ä Å Æ Ç È Ê É Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ù Ú Û Ü Ý Ÿ Þ Š Œ § ¿ ¥ ß à á â ã ä ç è é ê ÿ þ š œ ¢ £ ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý ÿ þ š]
for eg. - String can be "dear œ¢£, how are you," Then the output will be "
Untitled Page
dear œ¢£, how are y"
I am using Encoding.UTF8....
can any one please let me know that why compress() not returning whole string?
or is there any other way to achive this?
Code is here
private static string Compress(string data)
{
using (MemoryStream ms = new MemoryStream())
{
using (GZipStream zip = new GZipStream(ms, CompressionMode.Compress, true))
{
zip.Write(Encoding.UTF8.GetBytes(data), 0, data.Length);
}
return Convert.ToBase64String(ms.ToArray());
}
}