Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown unicode characters in Image source broken on iOS in New Architecture #43462

Closed
oblador opened this issue Mar 13, 2024 · 1 comment
Closed
Labels
Component: Image Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@oblador
Copy link
Contributor

oblador commented Mar 13, 2024

Description

In new architecture, both bridgeless and not, using the Fabric Image component on iOS with an image containing a strange unicode character, the image will not get rendered regardless if it's a local or remote asset.

In old arch and on android (old+new) this was not an issue.

It leads me to believe it has something to do with passing "invalid" strings between JS and Native.

Applies to current stable version and latest RC.

Steps to reproduce

  1. Name an image Test__.png.
  2. Render it with <Image source={require('../Test__.png')} />.
  3. Observe image in all modes but new arch iOS.

React Native Version

0.74.0-rc.3

Affected Platforms

Runtime - iOS

Areas

Fabric - The New Renderer

Output of npx react-native info

System:
  OS: macOS 14.3.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 198.14 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.16.1
    path: ~/.asdf/installs/nodejs/18.16.1/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 9.5.1
    path: ~/.asdf/plugins/nodejs/shims/npm
  Watchman:
    version: 2023.03.27.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /Users/joel/.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK:
    API Levels:
      - "28"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 32.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-32 | Google APIs ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10227.8.2321.11479570
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 3.0.3
    path: /Users/joel/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.0-rc.3
    wanted: 0.74.0-rc.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

Error: Asset not found: /ReproducerApp/rn_ï_.jpg for platform: ios
    at getAbsoluteAssetRecord (/ReproducerApp/node_modules/metro/src/Assets.js:111:11)
    at async getAsset (/ReproducerApp/node_modules/metro/src/Assets.js:207:18)
    at async Server._processSingleAssetRequest (/ReproducerApp/node_modules/metro/src/Server.js:310:20)
    at async Server._processRequest (/ReproducerApp/node_modules/metro/src/Server.js:392:7)

Reproducer

https://github.com/oblador/react-native-fabric-image-unicode-issue

Screenshots and Videos

Paper Fabric
Simulator Screenshot - iPhone 15 Pro - 2024-03-13 at 16 53 40 Simulator Screenshot - iPhone 15 Pro - 2024-03-13 at 16 56 36
@oblador oblador added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Mar 13, 2024
@cortinico cortinico added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Triage 🔍 labels Mar 13, 2024
@zhongwuzw
Copy link
Contributor

@oblador Hi, I think it should be fixed in #43502 .

huntie pushed a commit that referenced this issue Mar 18, 2024
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: #43502

Test Plan: Fixes #43462

Reviewed By: rshest

Differential Revision: D54944653

Pulled By: cortinico

fbshipit-source-id: 0bbd3d46c8e5c04ceffe7e0ebae46dc2ce9507df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Image Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants