Skip to content

Case conversion of names is not culture-independent #137

@scria1000

Description

@scria1000

On machines where the current culture is set to Turkish, case conversion of identifiers result in the letter I being lowercased to the dotless-i (ı) variant instead of i.

I noticed that the code uses culture-specific ToLower(), ToUpper() instead of ToLowerInvariant(), ToUpperInvariant()

Generated docker-compose.yml causes issues with docker compose due to non-English letters not being allowed.

This does not appear to break the tool for now, and it can be remedied with a simple search and replace.

Generated docker-compose.yaml

Generated appsettings.json

Steps to reproduce

If you are on Windows, install the Language pack for Turkish and set just the Regional format to Turkish.
Or you can just add these lines to the Program.cs of craftsman:

CultureInfo.DefaultThreadCurrentCulture = CultureInfo.GetCultureInfo("tr-TR");
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo("tr-TR");

Have a ProjectName/ContextName/DatabaseName and/or Entity/Property name that begins with the letter I such as Ingredients.

Further technical details

Craftsman version (dotnet tool list -g): 0.26.4

Similar issues in other projects

CommunityToolkit/dotnet#230

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions