I'm receiving messages from a JMS MQ queue which are supposedly utf-8
encoded. However on reading the out using msgText = ((TextMessage)msg).getText();
I get question marks where non standard characters were present. It seems possible to specify the encoding when using a bytemessage
, but I cant find a way to specify encoding while reading out the TextMessage
. Is there a way to solve this, or should I press for bytemessages
?
相关问题
- How do I delay JMS Message sending?
- How to convert a string to a byte array which is c
- Is JavaEE really portable?
- Character Encoding in iframes
- Including decimal equivalent of a char in a charac
相关文章
- iconv() Vs. utf8_encode()
- Spring JMS : Set ErrorHandler for @JmsListener ann
- When sending XML to JMS should I use TextMessage o
- Google app engine datastore string encoding proble
- ClassCastException: javax.naming.Reference cannot
- How can i get know that my String contains diacrit
- Python thinks a 3000-line text file is one line lo
- servlet request parameter character encoding
If the text is not decoded correctly, then probably the client is not sending the message with the utf-8 codec; this should work:
We tried adding
Dfile.encoding="UTF-8"
toWebsphere
's jvm and we addedIn our
MessageListener
. This worked for us, so then we took out theDfile.encoding
bit away and it still works for us.Due to preferred minimum configuration for
Websphere
we decided to leave it this way, also taking into account that we may easier switch theUTF-8
string by a setting from file or database.