urg, backing out, this breaks attaching files with non-ascii names on non-windows platforms

This commit is contained in:
cbiesinger%web.de 2003-04-19 14:16:35 +00:00
Родитель f8d7c8b06d
Коммит 79e2ea0435
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -3517,8 +3517,16 @@ nsresult nsMsgCompose::AttachmentPrettyName(const char* url, PRUnichar** _retval
char * leafName = fileSpec.GetLeafName(); char * leafName = fileSpec.GetLeafName();
if (leafName && *leafName) if (leafName && *leafName)
{ {
#ifdef MOZ_UNICODE
/* file URL is now in UTF-8 */ /* file URL is now in UTF-8 */
*_retval = ToNewUnicode(NS_ConvertUTF8toUCS2(leafName)); *_retval = ToNewUnicode(NS_ConvertUTF8toUCS2(leafName));
#else
nsAutoString tempStr;
nsresult rv = ConvertToUnicode(nsMsgI18NFileSystemCharset(), leafName, tempStr);
if (NS_FAILED(rv))
tempStr.AssignWithConversion(leafName);
*_retval = ToNewUnicode(tempStr);
#endif /* MOZ_UNICODE */
nsCRT::free(leafName); nsCRT::free(leafName);
return NS_OK; return NS_OK;
} }