Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Unified Diff: source/io/ufile.c

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/io/ufile.h ('k') | source/io/ufmt_cmn.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/io/ufile.c
diff --git a/source/io/ufile.c b/source/io/ufile.c
index 820071f1bcfc7a60d0286b0aa550d7f2ecf934a4..a8d8f0a3a60a6b7e9d0bf76b950925dad7923ff2 100644
--- a/source/io/ufile.c
+++ b/source/io/ufile.c
@@ -1,7 +1,7 @@
/*
******************************************************************************
*
-* Copyright (C) 1998-2013, International Business Machines
+* Copyright (C) 1998-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -27,10 +27,14 @@
#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"
@@ -148,6 +152,35 @@ u_fopen(const char *filename,
}
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,
const char *locale)
@@ -312,3 +345,4 @@ U_CAPI const UNumberFormat* U_EXPORT2 u_fgetNumberFormat(UFILE *file)
}
#endif
+#endif
« no previous file with comments | « source/io/ufile.h ('k') | source/io/ufmt_cmn.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698