modern-screenshot
modern-screenshot copied to clipboard
Error when rendering emoji on Safari
Steps To Reproduce
- open https://modern-screenshot.vercel.app/ on Safari 17.1 macos
- add emoji symbol to the page (😀)
- notice that there is an error in console
Unhandled Promise Rejection: URIError: String contained an illegal UTF-16 sequence.
<!-- Provide a log message if relevant -->
Your Environment
- modern-screenshot version on test env
- Safari 17.1, macOS Sonoma 14.1.1, apple chip
I had same problem here. After a bit of browsing of the code I found the removeControlCharacter flag and setting that to false seems to fix the issue. Note sure what the flag is supposed to do but it seems it removes too much.
So adding this to options should do the trick:
let options = {
features: {
removeControlCharacter: false
}
}
I had same problem here. After a bit of browsing of the code I found the removeControlCharacter flag and setting that to false seems to fix the issue. Note sure what the flag is supposed to do but it seems it removes too much.
So adding this to options should do the trick:
let options = { features: { removeControlCharacter: false } }
Thanks. you saved my day