Replace + space with html gmail / android chrome

Hi, I have a web application that uses mailto as

<a href="mailto: someone@example.com ?subject=This%20is%20the%20subject&amp; cc=someone_else@example.com &amp;body=This%20is%20the%20body" class="">Send email</a> 

but there is no meter that I always do this, replace the space with a character Image

+6
source share
1 answer

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 decode URIencode.

If you mean a problem with PHP (HTML), just do the same:

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

So, the line will be displayed correctly. See url encode .

Ok, but when I read your question for the third time: you can use spaces in this case HTML. This is an Android bug. Just use this:

 <a href="mailto: someone@example.com ?subject=This is the subject&amp; cc=someone_else@example.com ">Send Mail</a> 
+1
source

Source: https://habr.com/ru/post/976772/


All Articles