Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

replace + with space in html Gmail/Android chrome

Hi i have web application which uses mailto like

<a href="mailto:[email protected]?subject=This%20is%20the%20subject&amp;[email protected]&amp;body=This%20is%20the%20body" class="">Send email</a>

but no meter what i do it alway replace space with + sign Image

like image 701
Noman Avatar asked Oct 15 '14 10:10

Noman


1 Answers

Try to decode your String

just use Uri.encode(String).

subject = (EditText) findViewById(R.id.subject);
subject.setText(Uri.encode(WhatEverYourStringVarIs));

This will help you to decode the URIencode.

If you mean the PHP (HTML) Issue just do the same:

$encodeString = urlencode($encodeString);
echo $encodedString;

So the String will displayed proper. See this url encode.

Okay, but when i'm read your Question the third time: You can use Spaces in these HTML case. It is an Android Bug. Just use this:

<a href="mailto:[email protected]?subject=This is the subject&amp;[email protected]">Send Mail</a>
like image 62
Swen Ka Avatar answered Oct 22 '22 11:10

Swen Ka