3

I'm able to type Japanese characters into the textbox, and it displays well. However, when I click on the Save button, I view the text property of the textbox and its value is weird, such as 'テルからイ'

This is the value being sent and stored in the database. How do I get the normal Japanese characters that's being displayed in the textbox?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Cyprox
  • 31
  • 1
  • its value is weird such as '無料延泊' .. i just realized this automatically transforms into proper japanese characters on html – Cyprox Dec 03 '10 at 18:34

1 Answers1

0

What's going on is encoding and decoding. You can go to an online decoder to see what the characters you showed really look like. So, 無料延泊

becomes

無料延泊

You can do the decoding in JavaScript (before you save to the database) either using the string class in prototype or some inbuilt JavaScript methods or see Stack Overflow question How to decode HTML entities using jQuery?. Or you can decode on the server in C# using Html.Decode.

Community
  • 1
  • 1
PandaWood
  • 8,086
  • 9
  • 49
  • 54