/*
******************************************************************************
*
-* Copyright (C) 1998-2013, International Business Machines
+* Copyright (C) 1998-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
#include "locmap.h"
#include "unicode/ustdio.h"
+
+#if !UCONFIG_NO_CONVERSION
+
#include "ufile.h"
#include "unicode/uloc.h"
#include "unicode/ures.h"
#include "unicode/ucnv.h"
+#include "unicode/ustring.h"
#include "cstring.h"
#include "cmemory.h"
return result; /* not a file leak */
}
+U_CAPI UFILE* U_EXPORT2
+u_fopen_u(const UChar *filename,
+ const char *perm,
+ const char *locale,
+ const char *codepage)
+{
+ UFILE *result;
+ char buffer[256];
+
+ u_austrcpy(buffer, filename);
+
+ result = u_fopen(buffer, perm, locale, codepage);
+#if U_PLATFORM_USES_ONLY_WIN32_API
+ /* Try Windows API _wfopen if the above fails. */
+ if (!result) {
+ FILE *systemFile = _wfopen(filename, (UChar*)perm);
+ if (systemFile) {
+ result = finit_owner(systemFile, locale, codepage, TRUE);
+ }
+ if (!result) {
+ /* Something bad happened.
+ Maybe the converter couldn't be opened. */
+ fclose(systemFile);
+ }
+ }
+#endif
+ return result; /* not a file leak */
+}
+
U_CAPI UFILE* U_EXPORT2
u_fstropen(UChar *stringBuf,
int32_t capacity,
}
#endif
+#endif