Git Product home page Git Product logo

Comments (3)

florianeckerstorfer avatar florianeckerstorfer commented on September 22, 2024 1

In theory this would be possible by adding a rules for Emoji or other unicode characters. However, we do not have such a list at the moment, because I think there would be a lot of discussion around what is the correct name. Just looking at your example, you would translate ❤️ into love, some people would translate it into heart and the official description is red heart.

from slugify.

florianeckerstorfer avatar florianeckerstorfer commented on September 22, 2024 1

I'm closing this issue, if you're interesting you can create a rule set which you can use just for your project (here is a database with emoji names) and you can create a PR and we will take it under consideration.

from slugify.

ausi avatar ausi commented on September 22, 2024 1

@ShivPandey you can use the following code with the https://github.com/ausi/slug-generator library:

$slugGenerator = new SlugGenerator([
	'preTransforms' => [
		':: [:Symbol:]; :: Any-Name; \'\N{\' > \' \'; \'}\' > \' \';',
	],
]);

$slugGenerator->generate('💩'); // pile-of-poo
$slugGenerator->generate('🙃'); // upside-down-face

$slugGenerator->generate('unicode ♥'); // unicode-black-heart-suit
$slugGenerator->generate('unicode ❤'); // unicode-heavy-black-heart
$slugGenerator->generate('unicode ❤️'); // unicode-heavy-black-heart
$slugGenerator->generate('unicode 👍'); // unicode-thumbs-up-sign

This converts symbols to their unicode names, but as you can see in the examples above they might not be the exact names you are looking for.

from slugify.

Related Issues (20)

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.