4

I'm using Server.HtmlEncode on a utf-8 string in asp-classic, which works fine until there are some accents in the string e.g. Rüstü Recber, which appears as Rüstü Recber (Rüstü Recber in the source).

I've tried setting the Response.Charset property to utf-8 but this doesn't make any difference.

Mr Plough
  • 211
  • 1
  • 3
  • 11
  • Now you've solved it, you might want to supply your solution as an answer and mark it as Answered. Then this question wont come up in the Unanswered list anymore. :) – Richard A Nov 03 '08 at 01:29

4 Answers4

5

Update (Solved): Adding <%@CODEPAGE=65001%> at the start of the page corrected the problem (http://technet.microsoft.com/en-us/library/bb742422.aspx)

Many thanks for all of the suggestions.

Mr Plough
  • 211
  • 1
  • 3
  • 11
0

Check if the editor you are using to view the text is set to show utf-8.

Lucia
  • 4,657
  • 6
  • 43
  • 57
0

Did you try to UrlEncode as well?

dove
  • 20,469
  • 14
  • 82
  • 108
0

Are you sure that the string is correct before it is passed to HtmlEncode ? It looks like the string might be encoded wrong before it is passed to HtmlEncode.

Try to encode a string that you know is correct, and see if it is encoded correctly.

JacquesB
  • 41,662
  • 13
  • 71
  • 86