xml character encoding fix

git-svn-id: svn://code.dyne.org/veejay/trunk@157 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
Niels Elburg
2005-01-26 18:04:57 +00:00
parent 09cf602b89
commit d36bd3abcf

View File

@@ -1,7 +1,7 @@
/* /*
* Linux VeeJay * Linux VeeJay
* *
* Copyright(C)2002 Niels Elburg <elburg@hio.hen.nl> * Copyright(C)2002 Niels Elburg <elburg@hio.hen.nl> / <nelburg@looze.net>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@@ -1884,8 +1884,9 @@ unsigned char *UTF8toLAT1(unsigned char *in)
return (NULL); return (NULL);
} }
if (UTF8Toisolat1(out, &out_size, in, &in_size) != 0) { if (UTF8Toisolat1(out, &out_size, in, &in_size) != 0)
fprintf(stderr, "Cannot convert %s\n", in); {
veejay_msg(VEEJAY_MSG_ERROR, "Cannot convert '%s'", in );
free(out); free(out);
return (NULL); return (NULL);
} }
@@ -2578,6 +2579,7 @@ void CreateClip(xmlNodePtr node, clip_info * clip)
int clip_writeToFile(char *clipFile) int clip_writeToFile(char *clipFile)
{ {
int i; int i;
char *encoding = "UTF-8";
clip_info *next_clip; clip_info *next_clip;
xmlDocPtr doc; xmlDocPtr doc;
xmlNodePtr rootnode, childnode; xmlNodePtr rootnode, childnode;
@@ -2595,8 +2597,8 @@ int clip_writeToFile(char *clipFile)
CreateClip(childnode, next_clip); CreateClip(childnode, next_clip);
} }
} }
xmlSaveFormatFile(clipFile, doc, 1); //xmlSaveFormatFile(clipFile, doc, 1);
xmlSaveFormatFileEnc( clipFile, doc, encoding, 1 );
xmlFreeDoc(doc); xmlFreeDoc(doc);
return 1; return 1;