summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2014-05-20 02:01:38 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2014-05-20 02:01:58 -0700
commit393a84a16da1723e828bb4e9d82c6369ba98d0b1 (patch)
treec7c814c31a11f656c48f3462c85bad33abe48967
parentf14bba6943800576a00433dae4458f472b9aae7e (diff)
Fix regular expression subjects encoded in UTF-8.
-rw-r--r--Cydia/MIMEAddress.mm2
-rw-r--r--MobileCydia.mm2
2 files changed, 2 insertions, 2 deletions
diff --git a/Cydia/MIMEAddress.mm b/Cydia/MIMEAddress.mm
index e4dcbab..65f29ec 100644
--- a/Cydia/MIMEAddress.mm
+++ b/Cydia/MIMEAddress.mm
@@ -61,7 +61,7 @@
- (id) initWithString:(NSString *)string {
if ((self = [super init]) != nil) {
const char *data = [string UTF8String];
- size_t size = [string length];
+ size_t size = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
static Pcre address_r("^\"?(.*)\"? <([^>]*)>$");
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 97ff1d4..8e4c796 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -834,7 +834,7 @@ NSString *LocalizeSection(NSString *section) {
NSString *Simplify(NSString *title) {
const char *data = [title UTF8String];
- size_t size = [title length];
+ size_t size = [title lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
static Pcre square_r("^\\[(.*)\\]$");
if (square_r(data, size))