Extension's context menu on Safari does not show quote and emoji

0

I have this code:

enter image description here

It shows correctly on Google Chrome:

enter image description here

It just shows odd characters on Safari:

enter image description here

What could be the possible reason why the quote and emoji are not shown correctly?

1

0

It's working now

enter image description here

For some reasons, the extension builder of Xcode bundled the javascript strings wrongly

A solution is to convert the background.js to UTF-16. It involve three steps:

  1. Open the background.js in VS Code, and then click the UTF-8 button in the status bar:

enter image description here

  1. Select Save with encoding

enter image description here

  1. Select UTF-16 LE

enter image description here

Final step, build the Xcode Safari Extension project. You can now use accented characters and emojis to your heart's content

If anyone have a good idea why Xcode cannot build Safari extension straight out of a UTF-8 file, please offer some theory why it is so. Or if there are any other alternative solution to this problem

An bit shorter step (two steps), use iconv commandline utility to convert the UTF-8 file background.js to UTF-16LE, but it's not enough, the emojis and other characters still looks gibberish when Xcode build the project. Still need another step, that is, open the background.js in VS Code and then save it (Ctrl+S or command+S). Looks like VS Code is doing some corrections to a file when a file is set to different encoding. Final step, build the Xcode Safari Extension project

2021-12-04 09:34:20

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................