Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Special chars not being sent correctly in email

 
Adrian Airmil
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
The app is compiled using Maven. I'll look into specifying encoding in the POM. Thanks for your response.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic