By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,700 Members | 1,512 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,700 IT Pros & Developers. It's quick & easy.

Maintaining unicode content through mailto link...

P: 18
Hi all,
I am trying to pass unicode data through mailto links. The problems is, it gets garbled and does not appear in Outlook window in its proper format and instead takes weird chinese characters form. Can anyone tell me how to overcome this ?

Thanks in advance.
Jan 16 '09 #1
Share this Question
Share on Google+
18 Replies


acoder
Expert Mod 15k+
P: 16,027
Use the encodeURIComponent function.
Jan 16 '09 #2

P: 18
@acoder
thanx for the reply...but

encodeURIComponent will give me the string i want to encode, into encoded uri format. But what i want is not this.

I have already encoded my data in that form. It is the unicode content in that data which when taken to E-mail client, gets garbled. I want to maintain that unicode information.
Jan 16 '09 #3

acoder
Expert Mod 15k+
P: 16,027
Give me an example of unicode content. Also, is this mailto link being dynamically generated or is it already there in HTML code when the page loads?
Jan 18 '09 #4

P: 18
@acoder
By unicode content I mean, I have some data in Devnagari Script which is in range u0901 to u097f.

And yes this mailto link i have generated dynamically generated in the javascript. This data is not there when page loads.
Jan 19 '09 #5

acoder
Expert Mod 15k+
P: 16,027
Check that Outlook is set to support Unicode characters.

Can you post the code that you're working with.
Jan 19 '09 #6

P: 18
This is the input i give,
किताब पुणे
and this goes through a function in javascript which modifies the href by appending this string at the end as a subject of mail.

And what actually gets appended is given below as seen in outlook..
.िताब पुण?.

My Outlook does support unicode because if this text (किताब पुणे) is directly pasted in outlook, it gets rendered as it is.
Jan 20 '09 #7

acoder
Expert Mod 15k+
P: 16,027
Have you tried other mail readers?

You may also need to check your browser settings to see if it uses unicode for mailto links.
Jan 20 '09 #8

P: 18
I have just tried on outlook yet...but yes my browsers settings are configured to use utf-8 for mailto links. Still the problem persists....

Its the medium through which the data is transferred from browser to outlook which is garbling my unicode data...
Jan 21 '09 #9

acoder
Expert Mod 15k+
P: 16,027
Well, try another email client to find out whether it's a browser issue or an Outlook problem.
Jan 21 '09 #10

P: 18
I tested the thunderbird for it and the unicode text gets rendered correctly. Though my outlook is using default encoding as Unicode it is garbling the data.
Jan 21 '09 #11

acoder
Expert Mod 15k+
P: 16,027
Then it's not a browser or JavaScript problem really. It's an email client problem, specifically Outlook. You may need to check some help files/documentation or ask in a dedicated Outlook help-list, or, better still, use a better email client, or even better still, don't use mailto. Use a form and use server-side code to send email.
Jan 22 '09 #12

P: 18
thanks acoder...ur inputs were really valuable.
Feb 3 '09 #13

acoder
Expert Mod 15k+
P: 16,027
You're welcome. Did you manage to solve your problem in the end?
Feb 3 '09 #14

P: 18
I am trying to do so with the help of ASP but it is not working.
I have posted the problem im gettin in ASP in ASP forum. The link is given below...

http://bytes.com/topic/asp-classic/a...ails-using-asp

so far no responses....can u help ?
Feb 3 '09 #15

acoder
Expert Mod 15k+
P: 16,027
I'm not much of an ASP man, but hopefully someone will take a look soon.
Feb 3 '09 #16

P: 18
yea..hope so. thanx anyways.
Feb 4 '09 #17

P: 18
Bingo !

Those weird chinese characters were not chinese characters as such but ANSI form of the actual unicode content.

When I copied and pasted that weird stuff in HTML and saw in browser..it was the intended Unicode content !

So, my problem is solved now. Just thought to convey u so. Thanx for ur help so far.

The problem that still bugs me is, even though default encoding in my E-mail client is Unicode(UTF-8), why did it show my unicode data in ANSI form ?...any idea ?
Feb 27 '09 #18

acoder
Expert Mod 15k+
P: 16,027
Thanks for posting. It's always good to see a resolution of some sort. @theaj
That would probably be a question for Outlook experts - I don't know if there are any here. My initial reaction to that would be that it's an Outlook bug, but I may be proved wrong or there may be a workaround.

I still think, however, that you should restrict use of mailto: because of its problems and use server-side code.
Feb 27 '09 #19

Post your reply

Sign in to post your reply or Sign up for a free account.