Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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: 21421
94
Chrome Eclipse IDE Java 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: 23640
48
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!