From c08954c18b54897d2cea2903d0365a2336b1b7f5 Mon Sep 17 00:00:00 2001 From: Simon Wilson Date: Fri, 10 Dec 2021 22:36:14 +1100 Subject: [PATCH] Merge pull request #21227 from sbwilson:fix_framework_unicode_headers * fix unicode errors for framework headers This would crash if the header file included non-ASCII characters. This change ensures that headers are read and written as UTF-8 encoded files instead of ascii. * Adds spaces after commas --- platforms/ios/build_framework.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/ios/build_framework.py b/platforms/ios/build_framework.py index 0ce56321bf..09ac0197d8 100755 --- a/platforms/ios/build_framework.py +++ b/platforms/ios/build_framework.py @@ -406,11 +406,11 @@ class Builder: for dirname, dirs, files in os.walk(os.path.join(dstdir, "Headers")): for filename in files: filepath = os.path.join(dirname, filename) - with open(filepath) as file: + with codecs.open(filepath, "r", "utf-8") as file: body = file.read() body = body.replace("include \"opencv2/", "include \"" + name + "/") body = body.replace("include