Giter Club home page Giter Club logo

country-emoji's Introduction

"I've debugged codebases you wouldn't believe. Legacy systems cascading failures in production with no logs to recover. I witnessed endless meetings that sparked no innovation. All that history will be forgotten, like the intimate glory of our accomplishments."

image

country-emoji's People

Contributors

leodutra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

edmilsongimenez

country-emoji's Issues

code_to_flag behaves weirdly with lowercase country codes

Hey ๐Ÿ™‚ Thank you very much for providing this useful library! I noticed some unintuitive behaviour in the code_to_flag function, when supplying a country code in lowercase:

let correct = country_emoji::code_to_flag("DE"); // as_bytes returns [240, 159, 135, 169, 240, 159, 135, 170]
let incorrect = country_emoji::code_to_flag("de"); // as_bytes returns [240, 159, 136, 137, 240, 159, 136, 138]

I guess this happens because code_to_flag, unlike most other functions, doesn't use .to_uppercase() to normalize the input.

Expected behaviour

I'd either expect all methods to return None for lowercase codes, or the code_to_flag function to return the correct flag even when supplying a lowercase country code.

I'm happy to work on a fix for the problem if you don't have the time, but I'd need to know which behaviour you'd prefer.

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.