emojicon
emojicon copied to clipboard
How to store these emoji's to SQLite database and retrieve them?
Problem storing these emoji's to SQLite database and retrieving them as these emoji's support utf8mb4 encoding which is not supported by SQLite, i suppose. Currently if i try to store and retrieve from database it gives a ?? for each emoji.
How to store and retrieve these to android SQLite database.
What about encoding the codepoints to base64 or something?
Not working by encoding them to Base64...any other alternative? On Aug 18, 2014 1:25 AM, "Daniele Ricci" [email protected] wrote:
What about encoding the codepoints to base64 or something?
— Reply to this email directly or view it on GitHub https://github.com/rockerhieu/emojicon/issues/12#issuecomment-52432833.
I'm currently storing them on a database for my messages without any hassle and even without base64. On Android you don't even need to set an encoding, it's UTF-8 by default.
You are absolutely right about the default encoding scheme in android but the emojicon library emoji's are of utf8mb4 encoding scheme i suppose, which is not supported by Sqlite. Moreover i tried storing them without encoding, i didnt find any problem regarding storing, but while retrieving them from database and setting them to any view it shows me ?? for each emoji. Any idea about the problem? On Sep 27, 2014 7:57 PM, "Daniele Ricci" [email protected] wrote:
I'm currently storing them on a database for my messages without any hassle and even without base64. On Android you don't even need to set an encoding, it's UTF-8 by default.
— Reply to this email directly or view it on GitHub https://github.com/rockerhieu/emojicon/issues/12#issuecomment-57054278.
I guess you are using an EmojiconTextView to display them?
Yep, indeed am using emojicon textview to display after retrieving them from db. On Oct 1, 2014 12:14 PM, "Daniele Ricci" [email protected] wrote:
I guess you are using an EmojiconTextView to display them?
— Reply to this email directly or view it on GitHub https://github.com/rockerhieu/emojicon/issues/12#issuecomment-57425107.
I don't know what could be wrong... can you show us the code that stores and retrieves the data and displays it?
Well i'll try to make a demo and show it to you. Basically, according to what i understand, the problem might b the encoding scheme while storing the data.
I will explain you the scenario taking place in my case. I have made a web service, where the data that i entered is stored (data includes text as well as emoji) and as soon as i click on a button the data is passed on the api as string and stored to web db and the data that i sent which inckuded text and emoji will be returned from web db as response in json format, which i parse and store it in SQLite db in android and then i fetch it from db and set it to a emojicon textview. On Oct 1, 2014 12:18 PM, "Daniele Ricci" [email protected] wrote:
I don't know what could be wrong... can you show us the code that stores and retrieves the data and displays it?
— Reply to this email directly or view it on GitHub https://github.com/rockerhieu/emojicon/issues/12#issuecomment-57425372.
Oh I see now: the data does not go directly into SQLite and come back from it. It goes through a server and a server-side database, isn't it? You should check the encoding then you're probably right. But I think you loose the encoding in the server processing somehow.
I have the same problem.
Does Anyone got any solution ?
I need to save message from EmojiconEditText to database and after get data and show in a EmojiconTextView.
Is it possible ?
Yes indeed i have found one. The data type for the emoji to be stored on server, needs to be kept as NVARCHAR or equivalent. For me, that solved the problem of storing and retrieving emoji to and from db. On 4 Sep 2015 21:39, "Eduardo Gorio" [email protected] wrote:
I have the same problem.
Does Anyone got any solution ?
I need to save message from EmojiconEditText to database and after get data and show in a EmojiconTextView.
Is it possible ?
— Reply to this email directly or view it on GitHub https://github.com/rockerhieu/emojicon/issues/12#issuecomment-137778798.
Have you used SQLite ?
How to get text from EmojiconEditText ?
EmojiconEditText etMessage; etMessage.getText().toString()
@themitshah could you contact me [email protected] ? Thank you
you may store the emoticons from edit text as StringEscapeUtils.escapeJava(edittext.getText().toString()); to get it in unicode format.
and decode it back to emoticon u can use textview.setText(StringEscapeUtils.unescapeJava(<unicode_emoticon>));
i through "rails new scaffold p name :string description:text" and i use the sqlite,when the description has emoji, the sqlite can not store it ,how to deal it?thanks
I don't know if this is applicable to SQLite, but I just get the String from the EditText (EmojiconEditText.getText().toString()
), and then de/encode the string as described here. Works fine for MySQL
You can save the emoticons into Sqlite db by saving the emoticon's emoji i.e use StringEscapeUtils.escapeJava(EmojiconEditText.getText().toString()); to get the uniocode of the emoji and save it to Sqlite. To retrieve back the emoticon from that unicode use StringEscapeUtils.unescapeJava(<unicode_emoticon>); and set the value received from above to a textview which displays the required emoticon ..
Yes indeed i have found one. The data type for the emoji to be stored on server, needs to be kept as NVARCHAR or equivalent. For me, that solved the problem of storing and retrieving emoji to and from db. On 4 Sep 2015 21:39, "Eduardo Gorio" [email protected] wrote:
I have the same problem. Does Anyone got any solution ? I need to save message from EmojiconEditText to database and after get data and show in a EmojiconTextView. Is it possible ? — Reply to this email directly or view it on GitHub #12 (comment).
can you post your 'create table sql'