Hello
I have a problem using Aspose in a corporate environment.
I convert to HTML correctly imported Word documents from a webapp running on JBoss/Windows XP (developement environement) however running on WebSphere/Unix (production environement) things get bad as the format returned is UTF-16.
Here is the code used :
ByteArrayInputStream stream = new ByteArrayInputStream(byteArray);
Document documentAspose = new Document(stream);
ByteArrayOutputStream out = new ByteArrayOutputStream();
if (format == SaveFormat.HTML)
{
documentAspose.getSaveOptions().setHtmlExportEncoding(Charset.forName("UTF8"));
}
else if (format == SaveFormat.TEXT)
{
documentAspose.getSaveOptions().setTxtExportEncoding(Charset.forName("UTF8"));
}
documentAspose.save(out, format);
System.out.println(out);
And the returned wrong format (first few lines) :
ÿþ<�h�t�m�l�>�<�h�e�a�d�>�<�m�e�t�a�
�h�t�t�p�-�e�q�u�i�v�=�"�C�o�n�t�e�n�t�-�T�y�p�e�"�
�c�o�n�t�e�n�t�=�"�t�e�x�t�/�h�t�m�l�;�
�c�h�a�r�s�e�t�=�u�t�f�-�1�6�"�>�<�/�m�e�t�a�>�<�m�e�t�a�
�h�t�t�p�-�e�q�u�i�v�=�"�C�o�n�t�e�n�t�-�S�t�y�l�e�-�T�y�p�e�"�
�c�o�n�t�e�n�t�=�"�t�e�x�t�/�c�s�s�"�>�<�/�m�e�t�a�>
Normally the format should be UTF-8 and should not render those characters.
Do you have any clues ?
Thanks for your kind help.