Android Question Text copy to Mysql problem

Salimalhajri

Member
Licensed User
Longtime User
Hello
When i copy from Whatsapp contains icons
to the my application and sent into the database on the Internet
the text is saved in the database and stop at the first code or alternative ( Place first icon )

See Attachments

And when i sent the email reaches full
I just want the text without icons

Im changed the coding system in database tables, but to no avail

I want a solution

Sorry translation
 

Attachments

  • WGM.jpg
    238.5 KB · Views: 167

sorex

Expert
Licensed User
Longtime User
you only want to email the text?

send as html mail and replace the <img with <iii or something so that they get ignored as invalid html tags.
 
Upvote 0

Salimalhajri

Member
Licensed User
Longtime User
Thank you for your response

I found the problem in the database are not saved icons code

Is there a way to scan codes from the text before it is sent to the database
Such attachments
 

Attachments

  • SC_1.jpg
    76.3 KB · Views: 155
Upvote 0

sorex

Expert
Licensed User
Longtime User
these codes get translated to images inside the whatapp or whatever app.

you'll need to do the same thing and when reading the database records.
you need to replace the codes with an image link.
 
Upvote 0

Salimalhajri

Member
Licensed User
Longtime User
Hello sorex

Yes, I know that, but the problem is that the database does not receive the code and stop at the first one

Tried to add text directly in the database and receive an error message

Sent a message to the host to ask for help and wait for response

But I wrote this code a temporary solution
It works well and replaces the codes with *

B4X:
  Dim list_smiles As List
    list_smiles.Initialize
    Dim s_code As String
  s_code = E_TXT.Text
  list_smiles = File.ReadList(File.DirAssets,"smiles.txt")
  For i = 0 To list_smiles.Size-1
  s_code = s_code.Replace(list_smiles.Get(i),"*")
  Next
  E_TXT2.Text = s_code


The text file in the attachments for people interested CODE

Thanks All
 

Attachments

  • smiles.txt
    4.6 KB · Views: 182
Last edited:
Upvote 0

KMatle

Expert
Licensed User
Longtime User
You mean "emoticons"?

As Sorex said, you need UTF-8.

In MySQL set anything (Database and Table) to "UTF-8 Unicode CI"

In php use

mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES 'utf8'");

I can store & read all emoticons to/from my databases
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…