Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 20th, 2012  |  syntax: None  |  size: 0.66 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do we decode a string that was posted from other domain?
  2. ISO-8859-1,utf-8;q=0.7,*;q=0.3
  3.        
  4. var name = System.Text.Encoding.GetEncoding("iso-8859-1").GetBytes(model.Name);
  5. string n = System.Text.Encoding.UTF8.GetString( name );
  6.        
  7. var b = System.Text.Encoding.GetEncoding("iso-8859-1").GetBytes(model.Name);
  8.  
  9. b[0] = 63
  10. b[1] = 32
  11. b[2] = 63
  12. b[3] = 32
  13. b[4] = 63
  14.        
  15. application/x-www-form-urlencoded; charset=UTF-8
  16.        
  17. accept-charset="UTF-8"
  18. enctype="application/x-www-form-urlencoded; charset=UTF-8;"
  19.        
  20. <form method="post"
  21.       action="http://domain.com/subscribe"
  22.       accept-charset="UTF-8"
  23.       enctype="application/x-www-form-urlencoded; charset=UTF-8;">