• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Special chars not being sent correctly in email

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The java class has the following:

The server has the following set

-Dfile.encoding=ISO-8859-1


When a user enters a message on the web page, the message is appended to the commentLabel & reportedDateLabel properties and sent as the body of the email. The special chars that are part of the message received from the web page are sent correctly, where as the property values defined in the above java class are not sent correctly. They show as a upside down '?' in the email body.

I have verified the headers of the email received and it does state charset="ISO-8859-1"

Is there something I need to do to encode the property values to be rendered correctly along with the message from the form?
 
Adrian Airmil
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
bump. anyone?

Would this have anything to do with file.encoding? The app is built on a server which then deploys the JAR to another server which renders the app. Setting the -Dfile.encoding=ISO-8859-1 on the server that renders the app has been done. Is the issue described above possibly occurring due to the fact that the file.encoding on the server that compiles and builds the app may not have it set to ISO-8859-1?

Seems like this is turning into a server question at this point.
 
Adrian Airmil
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I've decompiled the class file which was compiled on the build server and this is what it contains

All the special chars show up as '\uFFFD'. What is this and how do I fix it?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you compiling this class with an appropriate "-encoding" switch? Otherwise javac won't know what to do with those characters: http://www.fileformat.info/info/unicode/char/fffd/index.htm
 
Adrian Airmil
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The app is compiled using Maven. I'll look into specifying encoding in the POM. Thanks for your response.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic