Body in text-method gets encoded with special characters
See original GitHub issueExample:
const myText = 'This is awesome!'; ... text(number, myText);
Output of myText in the messaging app is:
This%20is%20awesome!
Any way to quick fix this?
Running on iPhone 6
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Using URL encoding to handle special characters in a ...
URL encoding is often required to convert special characters (such as "/", "&", "#", ...), because special characters: have special meaning in ...
Read more >How to send '&' character in HTTP request body?
As you can read in the attached links you have to encode the ampersand sign. encodeURIComponent('&') gives "%26".
Read more >Using Special Characters in Query String - Caspio Online Help
This issue can be avoided by encoding the special characters using Caspio ... This method requires one Calculated Field for each Data Source...
Read more >Escaping Special Characters < JavaScript | The Art of Web
A guide to escaping special characters in JavaScript and PHP. Comparing JavaScript escape with PHP urlencode and rawurlencode. Converting spaces, quotes and ...
Read more >encodeURI() - JavaScript - MDN Web Docs
The encodeURI() function escapes characters by UTF-8 code units, with each octet encoded in the format %XX , left-padded with 0 if necessary....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
2.2.0 has been released with a new method
textWithoutEncoding
as a temporary workaround which you both can use. Keep in mind that if you have any text for the message which needs encoding (e.g. web urls) then you will be responsible for encoding yourself before passing to the method.Can you give it a go and let me know if this solves it for you in the short term?
I am going to be working on a V3 of the library which will include a major overhaul of all methods
@anarchicknight This workaround works for me. Ironically I am using it so a url is not encoded so a url can be sent in a text message. Using the other message the url is encoded and is not a valid link in the text message. So I have a noob question, because you said if I have a url I will need to encode on my own. My question is, why would I ever need to url encode anything when sending a text message? The contents are not being passed into a webview or anything. They are not clickable links? I can’t figure out what I am missing…