-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace URLEncoder.encode() with Uri.encode()
URLEncoder.encode() encodes ' ' as '+' and that's not handled by all email apps. Uri.encode() uses "%20" for ' '.
- Loading branch information
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package net.vonforst.evmap.api.nobil | ||
|
||
import android.net.Uri | ||
import androidx.core.text.HtmlCompat | ||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
@@ -16,7 +17,6 @@ import net.vonforst.evmap.model.OpeningHours | |
import net.vonforst.evmap.model.ReferenceData | ||
import net.vonforst.evmap.model.getBooleanValue | ||
import net.vonforst.evmap.model.getSliderValue | ||
import java.net.URLEncoder | ||
import java.time.Instant | ||
import java.time.LocalDateTime | ||
|
||
|
@@ -115,7 +115,7 @@ data class NobilChargerStation( | |
null, | ||
when (chargerStationData.landCode) { | ||
"SWE" -> "https://www.energimyndigheten.se/klimat/transporter/laddinfrastruktur/registrera-din-laddstation/elbilsagare/" | ||
else -> "mailto:[email protected]?subject=" + URLEncoder.encode("Regarding charging station " + chargerStationData.internationalId, "UTF-8").replace("+", "%20") | ||
else -> "mailto:[email protected]?subject=" + Uri.encode("Regarding charging station " + chargerStationData.internationalId) | ||
}, | ||
null, | ||
chargerStationData.ocpiId != null || | ||
|