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

Added support for Unicode characters #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

designly1
Copy link

Fixed a bug in front-end JavaScript where escaped Unicode characters were not being unescaped JSON.parse as a hack. Included most JSON escape characters in function but have not fully tested. It works with HTML and any character I can type on my keyboard. Also works with Unicode emojis.

Added Unicode parsing hack for Unicode escaped character sequences.
- Added all possible JSON escape sequences
@MattRuddick
Copy link
Owner

MattRuddick commented Aug 2, 2023

Thanks @designly1 for bringing this one up. It does seem that AWS returns from the getTemplate unicode chars which I imagine wouldn't be too helpful for the end user when editing a template. I confirmed the unicode issue by saving a new template with emojis (displays as expected in codemirror) but then later when editing we just get our unicode chars displayed.

I'm actually just wondering if we can use decodeURIComponent() for our syntax/subject/text etc. Some quick and brief testing on my end shows it could be a possible solution. Whilst your regex I would have no doubt it would work, this may be a much simpler one liner solution to solve the issue 🤞. Currently investigating.

@MattRuddick MattRuddick added the enhancement New feature or request label Aug 2, 2023
@BertramRay
Copy link

Fixed a bug in front-end JavaScript where escaped Unicode characters were not being unescaped JSON.parse as a hack. Included most JSON escape characters in function but have not fully tested. It works with HTML and any character I can type on my keyboard. Also works with Unicode emojis.

This patch works well in my case. Since I have to frequently update my template (with lots of emoji), it really enhances my efficiency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants