mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
iOS: Change image source url encode ascii to utf8 (#43502)
Summary: We should use utf8 to cover more characters. ## Changelog: [IOS] [FIXED] - [Fabric] iOS: Change image source url encode ascii to utf8 Pull Request resolved: https://github.com/facebook/react-native/pull/43502 Test Plan: Fixes https://github.com/facebook/react-native/issues/43462 Reviewed By: rshest Differential Revision: D54944653 Pulled By: cortinico fbshipit-source-id: 0bbd3d46c8e5c04ceffe7e0ebae46dc2ce9507df
This commit is contained in:
+2
-2
@@ -48,10 +48,10 @@ inline static NSURL *NSURLFromImageSource(const facebook::react::ImageSource &im
|
||||
{
|
||||
// `NSURL` has a history of crashing with bad input, so let's be safe.
|
||||
@try {
|
||||
NSString *urlString = [NSString stringWithCString:imageSource.uri.c_str() encoding:NSASCIIStringEncoding];
|
||||
NSString *urlString = [NSString stringWithUTF8String:imageSource.uri.c_str()];
|
||||
|
||||
if (!imageSource.bundle.empty()) {
|
||||
NSString *bundle = [NSString stringWithCString:imageSource.bundle.c_str() encoding:NSASCIIStringEncoding];
|
||||
NSString *bundle = [NSString stringWithUTF8String:imageSource.bundle.c_str()];
|
||||
urlString = [NSString stringWithFormat:@"%@.bundle/%@", bundle, urlString];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user