1

I have some code like the following.

.... some jquery code here .....
var fullAddress = '@Model.AddressParseResult.normalizedAddress.ToString()';

alert(fullAddress);
.... some jquery code here .....

The value of the "normalizedAddress" is "içerenköy" (it has turkish letters). However in alert window i get the result like:

içerenköy

I think i am doing something wrong about chracter encoding. Any idea how can i get the correct string ?

3
  • There are additional browser / page encoding issues to be aware if you are trying to alert Unicode characters: stackoverflow.com/questions/7006376/… Commented Jun 4, 2014 at 10:50
  • meta utf-8 have you included it? Commented Jun 4, 2014 at 10:53
  • Jai i have it already. anssi 's answer solved the problem. Commented Jun 4, 2014 at 11:08

2 Answers 2

2

@Html.Raw should put the correct encoding in place.

Sign up to request clarification or add additional context in comments.

Comments

1

exactly, you should use like this:

var address = '@Html.Raw(Model.AddressParseResult.normalizedAddress.ToString())';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.