Coder Social home page Coder Social logo

Comments (7)

matkoniecz avatar matkoniecz commented on July 28, 2024 1

@vbrazo At time of reporting it Faker was unable to handle UTF-8 letters, even by converting them to ASCII.

I see no reason to close this unless this issue is now fixed.

from faker.

matkoniecz avatar matkoniecz commented on July 28, 2024

I am using following fix in my script:

class Faker::InternetPL < Faker::Internet
    def self.user_name(name)
        changes = {
        "ą" => "a",
        "Ą" => "A",
        "ć" => "c",
        "Ć" => "C",
        "ę" => "e",
        "Ę" => "E",
        "ł" => "l",
        "Ł" => "L",
        "ń" => "n",
        "Ń" => "N",
        "ó" => "o",
        "Ó" => "O",
        "ś" => "s",
        "Ś" => "S",
        "ź" => "z",
        "Ź" => "Z",
        "ż" => "z",
        "Ż" => "Z",
        }
        changes.each do |old, new|
            name = name.gsub(old, new)
        end
        return super(name)
    end
end

from faker.

mhutter avatar mhutter commented on July 28, 2024

Note for someone willing to fix this: maybe stringex does the trick

from faker.

matkoniecz avatar matkoniecz commented on July 28, 2024

It seems that Polish is not listed below "Currently, built-in translations are available for the following languages:".

from faker.

vbrazo avatar vbrazo commented on July 28, 2024

@matkoniecz could we close this issue or you guys need help to solve it?

from faker.

vbrazo avatar vbrazo commented on July 28, 2024

@matkoniecz ok cool! Thanks for the quick follow-up. I'm going to take a look at this issue in the next days. Lemme know if you have any new ideas on how to solve it.

from faker.

matkoniecz avatar matkoniecz commented on July 28, 2024

As I reread it - I would expect Faker to just handle UTF-8 text.

Originally mentioned conversion to ASCII is an overcomplicated crutch that should not be necessary.

from faker.

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.