Marino Faggiana 7 years ago
parent
commit
f0ab78f721

+ 14 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -308,6 +308,7 @@
 		F76B3CD01EAE01BD00921AC9 /* NCBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76B3CCD1EAE01BD00921AC9 /* NCBrand.swift */; };
 		F76B3CD11EAE01BD00921AC9 /* NCBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76B3CCD1EAE01BD00921AC9 /* NCBrand.swift */; };
 		F76F23341ED4603700C40023 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = F76F23331ED4603700C40023 /* LaunchScreen.xib */; };
+		F773717E1F46E0B40024C5F3 /* libuchardet-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F773717D1F46E0B40024C5F3 /* libuchardet-ios.a */; };
 		F77B0DF01D118A16002130FE /* UIImage+Resizing.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F04CA1C889184008DAB36 /* UIImage+Resizing.m */; };
 		F77B0DF21D118A16002130FE /* CCUploadFromOtherUpp.m in Sources */ = {isa = PBXBuildFile; fileRef = F7956FCA1B4886E60085DEA3 /* CCUploadFromOtherUpp.m */; };
 		F77B0DF41D118A16002130FE /* CCMain.m in Sources */ = {isa = PBXBuildFile; fileRef = F70211FB1BAC56E9003FC03E /* CCMain.m */; };
@@ -1377,6 +1378,8 @@
 		F772BEB51EE69976006A232B /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
 		F772BEB61EE69976006A232B /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Intro.strings"; sourceTree = "<group>"; };
 		F772BEB71EE69976006A232B /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Error.strings"; sourceTree = "<group>"; };
+		F77371741F46E0AF0024C5F3 /* uchardet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uchardet.h; sourceTree = "<group>"; };
+		F773717D1F46E0B40024C5F3 /* libuchardet-ios.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libuchardet-ios.a"; sourceTree = "<group>"; };
 		F777F0301C29717F00CE81CB /* PHAsset+Utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "PHAsset+Utility.h"; sourceTree = "<group>"; };
 		F777F0311C29717F00CE81CB /* PHAsset+Utility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "PHAsset+Utility.m"; sourceTree = "<group>"; };
 		F77D49A71DC238E500CDC568 /* loading@2x.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "loading@2x.gif"; sourceTree = "<group>"; };
@@ -1951,6 +1954,7 @@
 				F714526D1DC1523B0006A5D4 /* libMagicalRecord.a in Frameworks */,
 				F75EDFAC1E8C106900E6F369 /* FirebaseAnalytics.framework in Frameworks */,
 				F75EDFAE1E8C106900E6F369 /* FirebaseInstanceID.framework in Frameworks */,
+				F773717E1F46E0B40024C5F3 /* libuchardet-ios.a in Frameworks */,
 				F7A377161EB2364A002856D3 /* Crashlytics.framework in Frameworks */,
 				F75EDFB11E8C106900E6F369 /* Protobuf.framework in Frameworks */,
 				F7FC7D561DC1F93800BB2C6A /* libz.tbd in Frameworks */,
@@ -3058,6 +3062,8 @@
 		F7B4F1C51F44356F00B53B42 /* NCUchardet */ = {
 			isa = PBXGroup;
 			children = (
+				F77371741F46E0AF0024C5F3 /* uchardet.h */,
+				F773717D1F46E0B40024C5F3 /* libuchardet-ios.a */,
 				F7B4F1C71F44356F00B53B42 /* NCUchardet.h */,
 				F7B4F1C81F44356F00B53B42 /* NCUchardet.m */,
 			);
@@ -5307,7 +5313,10 @@
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/iOSClient.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
-				LIBRARY_SEARCH_PATHS = "\"Libraries external\"/openssl";
+				LIBRARY_SEARCH_PATHS = (
+					"\"Libraries external/openssl\"",
+					"$(PROJECT_DIR)/iOSClient/Library/NCUchardet",
+				);
 				OTHER_LDFLAGS = (
 					"-Obj-C",
 					"-all_load",
@@ -5355,7 +5364,10 @@
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/iOSClient.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
-				LIBRARY_SEARCH_PATHS = "\"Libraries external\"/openssl";
+				LIBRARY_SEARCH_PATHS = (
+					"\"Libraries external/openssl\"",
+					"$(PROJECT_DIR)/iOSClient/Library/NCUchardet",
+				);
 				OTHER_LDFLAGS = (
 					"-Obj-C",
 					"-all_load",

BIN
iOSClient/Library/NCUchardet/libuchardet-ios.a


+ 92 - 0
iOSClient/Library/NCUchardet/uchardet.h

@@ -0,0 +1,92 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Universal charset detector code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 2001
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *          BYVoid <byvoid.kcp@gmail.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+#ifndef UCHARDET_H___
+#define UCHARDET_H___
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+
+typedef struct uchardet * uchardet_t;
+
+/**
+ * Create an encoding detector.
+ * @return a handle of a instance of uchardet
+ */
+uchardet_t uchardet_new(void);
+
+/**
+ * Delete an encoding detector.
+ * @param ud [in] handle of a instance of uchardet
+ */
+void uchardet_delete(uchardet_t ud);
+
+/**
+ * Feed data to an encoding detector.
+ * @param ud [in] handle of a instance of uchardet
+ * @param data [in] data
+ * @param len [in] number of byte of data
+ * @return non-zero number on failure.
+ */
+int uchardet_handle_data(uchardet_t ud, const char * data, size_t len);
+
+/**
+ * Notify an end of data to an encoding detctor.
+ * @param ud [in] handle of a instance of uchardet
+ */
+void uchardet_data_end(uchardet_t ud);
+
+/**
+ * Reset an encoding detector.
+ * @param ud [in] handle of a instance of uchardet
+ */
+void uchardet_reset(uchardet_t ud);
+
+/**
+ * Get an iconv-compatible name of the encoding that was detected.
+ * @param ud [in] handle of a instance of uchardet
+ * @return name of charset on success and "" on failure.
+ */
+const char * uchardet_get_charset(uchardet_t ud);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif