Paul Clapham wrote:So you are saying that data which is incorrectly encoded comes via SSH from another system? Okay, then when you receive it, if you have to convert it from bytes to chars, make sure that you use UTF-8 as the encoding.
I've just tried adding the bold line but it produred exaclty the same result as before.
on the backingBean, in the action:
/* String[0] as stdout, String[1] as stderr */
String[] results = sshBO.execCommand(cmd, timeout);
/* Done with SSH things */
sshBO.closeSession();
/* Bring the output and err to the presentation */
msg = results[1]+results[0];
FileServices.saveStringToSrc("F:/myoutput.txt", msg);
msg = new String(msg.getBytes("UTF8"), "UTF8");
on the JSP pages :
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://sakaiproject.org/jsf/sakai" prefix="sakai" %>
<f:view >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
...
<h:inputTextarea disabled="true" value="#{SSH.msg}" styleClass="myTextArea" ></h:inputTextarea>
Thank you. Is there anything else I can try?