class to make kind a url encode

hi there,

my users create a text within a textbox
the content i send by
system.openURL( “mailto:?subject=” … subject string … “&body=” … data string)
to the native mobile mail application.

that does works fine… TILL the user does not enter Emoji Coder or Arabic Letters etc.

does anyone has a class i could remove all emoji/arabic letters etc.
finally it looks just chars are allowed that does also work in the url bar.

till now i filter \n with %%a0 and " " with %20 but i don’t know all chars for arabic, emoji etc.
but than all that special chars would be lost,.

at all i just like to push the content the user wrote in the text box (if emoji, arabic or whatever) into an email. but as long corona does not support native emails ( i don’t like that the user has to enter smtp data) … i only see the way through open url(mailto:
any way… through encoding or whatever is welcome :slight_smile:
chris

[import]uid: 4795 topic_id: 14919 reply_id: 314919[/import]

@guruk,
you generally seem to get answers to your own questions, so I was wondering if I should try to respond to this one or not.

What you are wanting to remove is *unicode* characters, you need only ASCII characters in your string. Hope that is a good pointer for you to start with,

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 14919 reply_id: 55140[/import]

@jayantv
:slight_smile: lol, yes lucky wise i often find the answers faster than i get replies :slight_smile:

also i guess its not just ascii codes… as ascii includes ; & etc.

its tricky, as i would like to keep emoji codes for the user and even arabic letters etc.
but i can’t put them in a url.
and thats till now the only way (i really wish corona offer soon a api so i can create a
native email where i just push all my characters in) to create an email as described
above with openUrl … as that works over the url i have to encode or remove characters
that are not allowed in urls.

till now its experimenting… as i also come to the limit from the url length.

for example i would love to send a backup from my database to the user email.
with a native email function could be easy. now i would have to encode the database
into url encoded chars , transmit them by &body= so they come in the body text.

so what i am looking for: Any way to create an email (without that the user has to input smtp data) where all inputs appear that the user makes in his text box… if its emoji code or other letters (unicode etc) … :slight_smile:

thx for your interest to help
chris
[import]uid: 4795 topic_id: 14919 reply_id: 55165[/import]