I get messages from the jms mq queue which are supposedly utf-8 encoded. However, when reading using msgText = ((TextMessage) msg) .getText (); I get question marks where non-standard characters are present. It seems possible to specify the encoding when using bytemessage, but I cannot find a way to specify the encoding when reading TextMessage. Is there a way to solve this problem, or should I click on messages?
We tried adding Dfile.encoding="UTF-8"in Webspherejvm and we added
Dfile.encoding="UTF-8"
Websphere
source = new StreamSource(new ByteArrayInputStream( ((TextMessage) msg).getText().getBytes("UTF-8")));
MessageListener. , Dfile.encoding, .
MessageListener
Dfile.encoding
- Websphere , , UTF-8 .
UTF-8
, , utf-8; :
byte[] by = ((TextMessage) msg).getText().getBytes("ISO-8859-1"); String text = new String(by,"UTF-8");
Source: https://habr.com/ru/post/1748510/More articles:oracle - do not tolerate drops - oracleSerializing the object graph in .NET and updating the code version - .netHow to resolve the key length restriction index 900 in a column with varchar (4096) data type in SQL Server 2005? - indexingHow to update property view in Eclipse RCP? - propertiesThreads from several processes actually work - multithreadingPHP live chat with ajax poll - ajaxA PCRE (recursive) pattern that matches a string containing the correct substring in brackets. Why is this failure? - regexКомпозитная форма WPF - wpfEXCEL Help VBA - empty cell insertion function - vbahow to replicate href = "... # something" using jquery - jqueryAll Articles