[TIMOB-5462] Hash in url when using openURL gets escaped - 1.7.2 / 1.8.x
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-10-11T10:28:50.000+0000 |
Affected Version/s | Release 1.7.2, Release 1.8.0 |
Fix Version/s | Sprint 2011-41 |
Components | iOS |
Labels | n/a |
Reporter | Eduardo Gomez |
Assignee | Qing Gao |
Created | 2011-10-06T16:19:48.000+0000 |
Updated | 2017-03-02T22:20:37.000+0000 |
None of these scape characters worked, to show an apostrophe {noformat} U+0027; /U0027 ’ ’ ’ ' &39; ‘ %27 {noformat}
The client code should be properly encoding the URL before passing it to the openURL API using Ti.Network.encodeURIComponent.
We can solve this problem by two steps. 1. Use the following defined fixedEncodeURIComponent function to replaced some Unescaped characters with their encoded code. function fixedEncodeURIComponent (str) { return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28'). replace(/\)/g, '%29').replace(/\*/g, '%2A'); } 2. Replace "mobile.twitter.com" with "twitter.com" in the URL.
Closing ticket as invalid.