Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Emoji in Telegram push message


Question

Posted

Hi all

I am using the excellent Telegram push function as per below topic. I am trying to add an emoji inside of a push message. Have tried number of different unicode ways I found on google but none seem to work and the code comes through as text.

 

Amongst the ones I have tried are:

 

U+1F600

u'\U000026C4'

\u{1F604}

\xF0\x9F\x98\x81

 

etc

 

 

9 answers to this question

Recommended Posts

  • 0
Posted

The topic has been moved from "

Please login or register to see this link.

" to "

Please login or register to see this link.

".

 

Temat został przeniesiony z "

Please login or register to see this link.

" do "

Please login or register to see this link.

".

  • 0
Posted (edited)

Hi @mrtn,

 

I use table where I store all emoji UTF codes:

Please login or register to see this code.

and then when I need it I add it to the string with this method:

Please login or register to see this code.

This will be available with new version of Sunrise & Sunset VD which will add emoji table to global variable and then will be available for all other code.

 

BTW I get this codes on Apple Mac. Mac shows codes in hexadecimal format but I translated them to decimal because hexadecimal notation was not working for me.

 

I don't use Telegram push at the moment but above is working with Fibaro push and popup messages and emoji are shown properly on Apple and Android devices and only Windows has problems but that is expected :-P 

Edited by Sankotronic
  • Like 1
  • Thanks 1
  • 0
  • Inquirer
  • Posted

    Thanks @Sankotronic!

     

    Your solution works beautifully!

    • 0
  • Inquirer
  • Posted

    @Sankotronic just looking at the emoji codes on google and can't find any UTF format to match yours. Would you mind explaining where you get the codes from? Thanks

    • 0
    Posted
    11 hours ago, mrtn said:

    @Sankotronic just looking at the emoji codes on google and can't find any UTF format to match yours. Would you mind explaining where you get the codes from? Thanks

     

    20 hours ago, Sankotronic said:

    BTW I get this codes on Apple Mac. Mac shows codes in hexadecimal format but I translated them to decimal because hexadecimal notation was not working for me.

     

    • 0
    Posted

    Hi @Sankotronic ,

    please, can you share how did you create UTF code table for emoji?

    Thank you very much

    Martin

     

     

    • 0
  • Inquirer
  • Posted
    On 9/5/2018 at 12:23 PM, marbe said:

    Hi @Sankotronic ,

    please, can you share how did you create UTF code table for emoji?

    Thank you very much

    Martin

     

     

     

    Below is working code/format of @Sankotronic's solution:

     

    Please login or register to see this code.

     

    • 0
    Posted

    yes, this is the only solution I found, to add to code fixed decimal UTF8 emoji code.

    My code table bellow, then in LUA code replace it.

    Please login or register to see this code.

     

    • Like 1
    • 0
    Posted (edited)

    Hi,

     

    I get all emoji's codes from my Apple computer. When I copy character info and I paste it to plain text document it looks like this:

     

    Please login or register to see this image.

    /monthly_2018_09/135950118_Lightbulb.jpg.c87a09974d26101d1a218adb30cfe7bc.jpg" alt="135950118_Lightbulb.jpg.c87a09974d26101d1a218adb30cfe7bc.jpg" />

    Please login or register to see this code.

     

    Then I change UTF-8 code in hexadecimal format F0 9F 92 A1 to decimal format and use \ to tell LUA that it is byte format:

     

    Please login or register to see this code.

     

    Like this it is possible to make table of emojis and even store it to global variable so it will be available to all code on HC2. That is what I did for UHAS and here is document with all emojis that will be available in UHAS:

     

    Please login or register to see this attachment.

     

    Since different operating system uses different approach to display emojis it is possible that you will not be able to see some of the emojis on Windows and some will look differently on Android devices. Even older Apple Mac OS will not be able to show some of the newer emojis while others will look differently than on the latest macOS.

     

     

    Edited by Sankotronic

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...