question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Body in text-method gets encoded with special characters

See original GitHub issue

Example: 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:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
anarchicknightcommented, Jan 13, 2017

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

0reactions
kcalmescommented, Jul 13, 2017

@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…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found