I'd just written a java file using Eclipse encoding with ISO-8859-1. In this file, I want to create a String such like that (in order to create a XML content and save it into a database) :
// <image><img src="path_of_picture"></image>
String xmlContent = "<image><img src=\"" + path_of_picture+ "\"></image>";
In another file, I get this String and create a new String with this constructor :
String myNewString = new String(xmlContent.getBytes(), "UTF-8");
In order to be understood by a XML parser, my XML content must be converted to :
<image><img src="path_of_picture"></image>
Unfortunately, I can't find how to write xmlContent to get this result in myNewString. I tried two methods :
// First :
String xmlContent = "<image><img src=\"" + content + "\"></image>";
// But the result is just myNewString = <image><img src="path_of_picture"></image>
// and my XML parser can't get the content of <image/>
//Second :
String xmlContent = "<image><img src=\"" + content + "\"></image>";
// But the result is just myNewString = <image>&lt;img src="path_of_picture"&gt;</image>
Do you have any idea ?