Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Sending strange characters in JavaMail  RSS feed

 
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I written a program by using javaMail API but when am sending mail in English language I receive in readable shape but when am sending mail in Arabic then am receiving strange characters. What should I do?

Thanks & best regards
 
Sheriff
Posts: 21465
97
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change the charset you are using. I believe the charset is part of the content type in emails. For instance, from one of my own emails:

Just use the same for your emails but then of course with a charset that supports Arabic characters.
 
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it really as simple as setting the charset?

Do the RFC's allow non-ASCII in the headers?

I assume that non-ASCII bodies are simply converted as MIME-parts during transport.
 
Sheriff
Posts: 23873
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pat Farrell wrote:Do the RFC's allow non-ASCII in the headers?



Yes, they do. And JavaMail takes care of implementing the complicated escaping that the RFCs require.
 
Pat Farrell
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote: JavaMail takes care of implementing the complicated escaping that the RFCs require.


I bet is quite complicated.

In the olden days, when I spoke RFC, the headers had to be 8-bit clean. And they really wanted 7 bit US ASCII.

Guess the Internet really is international.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!