plug-ins/common/psd-load.c use UTF-16 encoding instead of UCS-2 for layer

2007-07-06  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/psd-load.c 
	* plug-ins/common/psd-save.c: use UTF-16 encoding instead of 
UCS-2
	for layer names (bug #445316).


svn path=/trunk/; revision=22890
This commit is contained in:
Sven Neumann
2007-07-06 18:02:35 +00:00
committed by Sven Neumann
parent b7c967a9de
commit ee0572b45d
3 changed files with 16 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2007-07-06 Sven Neumann <sven@gimp.org>
* plug-ins/common/psd-load.c
* plug-ins/common/psd-save.c: use UTF-16 encoding instead of UCS-2
for layer names (bug #445316).
2007-07-06 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcontainertreeview.c

View File

@ -3100,13 +3100,12 @@ getunicodepascalstring (FILE *fd,
tmpunichunk = g_new (gunichar2, len + 1);
/* Slower but necessary to get correct endianness */
for (count=0; count < len; count++)
for (count = 0; count < len; count++)
tmpunichunk[count] = getgint16 (fd, why);
tmpunichunk[len]=0;
tmpunichunk[len] = 0;
tmpchunk = g_convert ((gchar *) tmpunichunk, len * 2, "UTF-8", "UCS-2",
NULL, NULL, NULL);
tmpchunk = g_utf16_to_utf8 (tmpunichunk, len, NULL, NULL, NULL);
g_free (tmpunichunk);

View File

@ -494,17 +494,16 @@ write_datablock_luni (FILE *fd,
{
if (val)
{
guint32 count;
guint32 xdBlockSize;
gsize numbytes;
gchar *luniName;
guint32 count;
guint32 xdBlockSize;
glong numchars;
gunichar2 *luniName;
luniName = g_convert_with_fallback (val, -1, "UCS-2", "UTF-8",
NULL, NULL, &numbytes, NULL);
luniName = g_utf8_to_utf16 (val, -1, NULL, &numchars, NULL);
if (luniName)
{
guchar len = (numbytes > 510) ? 255 : numbytes / 2;
guchar len = MIN (numchars, 255);
/* Only pad to even num of chars */
if( len % 2 )
@ -519,7 +518,7 @@ write_datablock_luni (FILE *fd,
write_gint32 (fd, xdBlockSize, "luni xdb size");
write_gint32 (fd, len, "luni xdb pascal string");
for (count = 0; count < len * 2; count += 2)
for (count = 0; count < len; count++)
write_gint16 (fd, luniName[count], "luni xdb pascal string");
/* Pad to an even number of chars */