aspose file tools*
The moose likes Java in General and the fly likes Special chars not being sent correctly in email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Special chars not being sent correctly in email" Watch "Special chars not being sent correctly in email" New topic
Author

Special chars not being sent correctly in email

Adrian Airmil
Greenhorn

Joined: Dec 12, 2005
Posts: 24
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

Joined: Dec 12, 2005
Posts: 24
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

Joined: Dec 12, 2005
Posts: 24
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
Marshal

Joined: Mar 22, 2005
Posts: 42601
    
  65
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


Ping & DNS - my free Android networking tools app
Adrian Airmil
Greenhorn

Joined: Dec 12, 2005
Posts: 24
The app is compiled using Maven. I'll look into specifying encoding in the POM. Thanks for your response.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Special chars not being sent correctly in email