Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Commit

Permalink
fix parsing of unicode parameters on ios/tvos, fixes #360
Browse files Browse the repository at this point in the history
  • Loading branch information
tanersener committed Mar 9, 2020
1 parent e5f9f72 commit 8af793f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ios/src/MobileFFmpeg.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ + (NSArray*)parseArguments: (NSString*)command {
} else {
previousChar = 0;
}
char currentChar = [command characterAtIndex:i];
unichar currentChar = [command characterAtIndex:i];

if (currentChar == ' ') {
if (singleQuoteStarted || doubleQuoteStarted) {
[currentArgument appendFormat: @"%c", currentChar];
[currentArgument appendFormat: @"%C", currentChar];
} else if ([currentArgument length] > 0) {
[argumentArray addObject: currentArgument];
currentArgument = [[NSMutableString alloc] init];
Expand All @@ -141,20 +141,20 @@ + (NSArray*)parseArguments: (NSString*)command {
if (singleQuoteStarted) {
singleQuoteStarted = false;
} else if (doubleQuoteStarted) {
[currentArgument appendFormat: @"%c", currentChar];
[currentArgument appendFormat: @"%C", currentChar];
} else {
singleQuoteStarted = true;
}
} else if (currentChar == '\"' && (previousChar == 0 || previousChar != '\\')) {
if (doubleQuoteStarted) {
doubleQuoteStarted = false;
} else if (singleQuoteStarted) {
[currentArgument appendFormat: @"%c", currentChar];
[currentArgument appendFormat: @"%C", currentChar];
} else {
doubleQuoteStarted = true;
}
} else {
[currentArgument appendFormat: @"%c", currentChar];
[currentArgument appendFormat: @"%C", currentChar];
}
}

Expand Down

0 comments on commit 8af793f

Please sign in to comment.