emoticons

How to avoid Twitter emoticon character while processing string in Java

心不动则不痛 提交于 2019-12-13 13:27:33
问题 I'm working on processing Tweets from Twitter and storing them in a database (MySQL). I have my process running perfectly but sometimes I get an error like this one: 2012-08-31 08:11:23,303 WARN org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Error: 1366, SQLState: HY000 2012-08-31 08:11:23,304 ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Incorrect string value: '\xF0\x9F\x98\x9D #...' for column 'twe_text' at row 1 When looking for the problematic tweet in my logs I find

How to detect emoticons in EditText in android

江枫思渺然 提交于 2019-12-13 11:49:51
问题 I want to detect whether my EditText contains smilie (emoticons) or not. But I have no idea that how to detect them. 回答1: To disable emoji characters when typing on the keyboard I using the following filter: InputFilter filter = new InputFilter() { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { for (int i = start; i < end; i++) { int type = Character.getType(source.charAt(i)); //System.out.println("Type : " + type); if (type

Convert drawable to a specific string

喜夏-厌秋 提交于 2019-12-12 05:18:28
问题 I have a chat app which I want to extend with emoticons. This code is used to insert a smilie in the text: Spanned cs = Html.fromHtml("<img src ='"+ index +"'/>", imageGetter, null); int cursorPosition = content.getSelectionStart(); content.getText().insert(cursorPosition, cs); This is working great. The smilies show up in the textView at the right place. Now I want to send the text to my server via HTTP. I would like to store ":)" instead of the image as for ones using an older app version

Storing Spannable to a string

泄露秘密 提交于 2019-12-11 18:57:59
问题 i'm writing a chat application, and to parse emotion icons i use code from here Displaying emoticons in Android my chat text is stored like "SENDER|TIME|NON_PARSED_CHAT_TEXT" in an ArrayList the problem is that i have all chat messages (time and sender and chat text) in a single string, and i split it and display it in a row in a ListView, each time i get this chat text and re-parse it for the emotion icons, is there any possible way to store Spannable object (chat text after parsing resulted

Blackberry - Smileys in text field

▼魔方 西西 提交于 2019-12-11 07:29:16
问题 I'm looking for a way to insert emoticons/smileys/any bitmap in a text field (LabelField, EditField, whatever). From what I've researched so far, there is no direct way to do this, so I'm stuck with trying to simulate this behavior. I was thinking of using a normal text field and instead of smileys to insert blank spaces and then place some BitmapFields over the text field where the smileys should be. The problem is that I have no reliable/quick way of finding a character's position on screen

Replace emoticon with word in tweet using regex c#

淺唱寂寞╮ 提交于 2019-12-11 05:26:09
问题 Basically the idea is to map the emoticons in the string to actual words. say for :) you replace it with happy. A more clear example would be. Original: Today is a sunny day :). But tomorrow it is going to rain :(. Final: Today is a sunny day happy. But tomorrow it is going to rain sad. I have trying a solution using a common regex for all emoticons but I am not sure once you detect it is an emoticon, how to go back and replace each one with appropriate word. I need it only for three

Prevent replacements of emoticons in HTML-tags

一个人想着一个人 提交于 2019-12-11 02:54:45
问题 I use a simple str_replace -function to replace some emoticons on my website… <?php $replace = array( ':)' => 'smile', ';)' => 'wink', … ); $string = 'Lorem ipsum ("dolor") sit amet! :)'; foreach($replace as $search => $replace) { $string = str_replace($search, '<img src="/img/'.$replace.'.png" alt="'.$search.'">', $string); } ?> The problem about this simple replacement is, that ";)" from the " -tag would be replaced aswell and the HTML-code would be broken. Is there any way/workaround (a

Font-awesome: An emoticon looks different on my computer than on the actual webpage

无人久伴 提交于 2019-12-11 01:59:13
问题 I am trying to add on my webpage the ResearchGate emoticon from academicons which is an extension to font-awesome. Here is what the emoticon should look like: It works fine when I open my index.html on my computer ( user/name/path/to/index.html ) but it doesn't work when I open my webpage ( www.blabla.bla.bl ). Of course, I made really sure to copy ( scp ) my whole directory (including, images, css, etc..) over the server several times. I made it several times and have now waited 10 hours but

How to find a textual description of emoticons, unicode characters and emoji in a string (python, perl)? [closed]

夙愿已清 提交于 2019-12-10 10:34:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . The detection and counting of emoticon icons has been addressed previously. As a follow-up on this question and the solution provided, I'd like extend it with ability to link the detected emoticons, unicode characters and emoji to their corresponding (textual) descriptions: emoticons (Western and Eastern, e.g.

Java string replaceAll()

蹲街弑〆低调 提交于 2019-12-10 10:06:31
问题 I've been wondering if for example: JTextPane chatTextArea = new JTextPane(); s.replaceAll(":\\)", emoticon()); public String emoticon(){ chatTextArea.insertIcon(new ImageIcon(ChatFrame.class.getResource("/smile.png"))); return "`"; } can put a picture and a "`" everywhere ":)" is found. When I run it like this if s contains a ":)" then the whole s gets replaced just by the icon. Is there a way to do it? 回答1: Here is a small example I made (+1 to @StanislavL for the original), simply uses