Code Monkey home page Code Monkey logo

Comments (2)

earthgecko avatar earthgecko commented on June 24, 2024

Hi @konsumer

You probably want to use something like the emoji module and check if the key value has an emoji in it and if so then demojize the key value, something like https://stackoverflow.com/a/51007945 and https://gist.github.com/jezdez/0185e35704dbdf3c880f

# You will need to install emoji with pip and then import it in runserver.py
import emoji

# Then around line 219 https://github.com/marians/rebrow/blob/master/runserver.py#L219
    if t == "string":
        val = r.get(key).decode('utf-8', 'replace')
# Let us say the val was
# val = u'I \u2764 emoji'
   def char_is_emoji(character):
        return character in emoji.UNICODE_EMOJI
    if [c for c in val if char_is_emoji(c)]:
        val = emoji.demojize(val)
# Which will result in val
# u'I :red_heart: emoji'

This is just an example but may work for you, in the very least it is somewhere to start.

from rebrow.

konsumer avatar konsumer commented on June 24, 2024

I could just strip any utf8 chars outside the ascii range, but It's in my data. I want to keep the emojis. I am just reporting that rebrow freaks on those records.

from rebrow.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.