I am trying to send nepali sms and i am facing issue when we get value from form field
Message example "मेरो नाम सागर हो"
when i pass through jsp page and sysout in java its string value is "Ã Â¤Â®Ã Â¥ÂÃ Â¤Â°Ã Â¥Â Ã Â¤Â¨Ã Â¤Â¾Ã Â¤Â® Ã Â¤Â¸Ã Â¤Â¾Ã Â¤ÂÃ Â¤Â° Ã Â¤Â¹Ã Â¥Â" and when sending this value through sms API we are getting same garble text instead of "मेरो नाम सागर हो"
But when I set static string message value example message="मेरो नाम सागर हो" and sysout value is "à¤®à¥à¤°à¥ à¤¨à¤¾à¤® à¤¸à¤¾à¤à¤° à¤¹à¥" and when sending this value through sms API we are getting correct sms with मेरो नाम सागर हो msg
So I stuck with this dynamic content get through form field any sort of help means alot.
prajapatisagar Sagar wrote:I am doing System.out.println() in eclipse IDE
Like Tim said, don't do that. You don't know what encoding it's using or even whether it's writing to a console which supports Unicode. If you want to test data in your code, write it to a file using a Writer with UTF-8 as encoding, and then use an editor which supports both UTF-8 and a Nepali font to look at that file.
But your JSP: it's clear that as the data goes from the client machine to your server it's being corrupted. That's probably because you didn't force that communication to be in UTF-8. (The servlet spec defaults to ISO-8859-1 for that encoding, which was a blunder by the people who wrote the spec but now we're stuck with that.)
Actually in your case it's better to just send an SMS to test the data, since that appears to work correctly for correctly-encoded characters like your static variable.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop