static void scene_dump_utf_string(GF_SceneDumper *sdump, Bool escape_xml, char *str)
{
	u32 len, i;
	u16 *uniLine;
	if (!str) return;
	len = (u32) strlen(str);
	if (!len) return;
	uniLine = (u16*)gf_malloc(sizeof(u16) * len*4);
	len = gf_utf8_mbstowcs(uniLine, len, (const char **) &str);
	if (len != GF_UTF8_FAIL) {
		for (i=0; i<len; i++) {
			//if (uniLine[i] == (u16) '\"') gf_fprintf(sdump->trace, "\\");
			switch (uniLine[i]) {
			case '\'':
				if (escape_xml) gf_fprintf(sdump->trace, "&apos;");
				else gf_fprintf(sdump->trace, "'");
				break;
			case '\"':
				if (escape_xml) gf_fprintf(sdump->trace, "&quot;");
				else gf_fprintf(sdump->trace, "\"");
				break;
			case '&':
				gf_fprintf(sdump->trace, "&amp;");
				break;
			case '>':
				gf_fprintf(sdump->trace, "&gt;");
				break;
			case '<':
				gf_fprintf(sdump->trace, "&lt;");
				break;
			case '\r':
			case '\n':
				/* Does nothing : gf_fprintf(sdump->trace, "");, fflush instead ?*/
				break;
			default:
				if (uniLine[i]<128) {
					gf_fprintf(sdump->trace, "%c", (u8) uniLine[i]);
				} else {
					gf_fprintf(sdump->trace, "&#%d;", uniLine[i]);
				}
				break;
			}
		}
	}
	gf_free(uniLine);
}
static void scene_dump_utf_string(GF_SceneDumper *sdump, Bool escape_xml, char *str)
{
	u32 len, i;
	u16 *uniLine;
	if (!str) return;
	len = (u32) strlen(str);
	if (!len) return;
	uniLine = (u16*)gf_malloc(sizeof(u16) * len*4);
	len = gf_utf8_mbstowcs(uniLine, len, (const char **) &str);
	if (len != GF_UTF8_FAIL) {
		for (i=0; i<len; i++) {
			 
			switch (uniLine[i]) {
			case '\'':
				if (escape_xml) gf_fprintf(sdump->trace, "&apos;");
				else gf_fprintf(sdump->trace, "'");
				break;
			case '\"':
				if (escape_xml) gf_fprintf(sdump->trace, "&quot;");
				else gf_fprintf(sdump->trace, "\"");
				break;
			case '&':
				gf_fprintf(sdump->trace, "&amp;");
				break;
			case '>':
				gf_fprintf(sdump->trace, "&gt;");
				break;
			case '<':
				gf_fprintf(sdump->trace, "&lt;");
				break;
			case '\r':
			case '\n':
				 
				break;
			default:
				if (uniLine[i]<128) {
					gf_fprintf(sdump->trace, "%c", (u8) uniLine[i]);
				} else {
					gf_fprintf(sdump->trace, "&#%d;", uniLine[i]);
				}
				break;
			}
		}
	}
	gf_free(uniLine);
}