mp-html icon indicating copy to clipboard operation
mp-html copied to clipboard

fix: 解决emoji在content.length中占2长度,substring时却只算1长度的问题

Open hiro0729 opened this issue 10 months ago • 4 comments

已解决 #650 中提到的问题,本地运行截图效果如下

微信截图_20250611211702

hiro0729 avatar Jun 11 '25 14:06 hiro0729

image emojisubstring 里也是 2 个长度吧 另外我在示例项目里测试这个内容也是正常的 image

jin-yufeng avatar Jun 15 '25 12:06 jin-yufeng

@jin-yufeng 我的substring和你的效果不一样,是环境问题,你的是mac电脑么?看来是不同js环境中的substring表现不一致 wechat_2025-06-15_220946_036

hiro0729 avatar Jun 15 '25 14:06 hiro0729

IOS 18真机也一样可以复现 微信图片_2025-06-15_221803_348

hiro0729 avatar Jun 15 '25 14:06 hiro0729

🤦🏻‍♂️这种扩展的emoji的length是7更夸张,substring各种长度能分割出各种结果,我现在小程序本地修改后也能正常显示

wechat_2025-06-16_103314_720 wechat_2025-06-16_103436_864

hiro0729 avatar Jun 16 '25 02:06 hiro0729