Skip to content

Property names with special characters (ä,ö,ü) are converted to unicode strings #30

@skriebi

Description

@skriebi

Hello,

some of the columns in our database contains special characters (ä,ö,ü).
The characters are converted to ä, ö or ü unicode strings.

To solve the issue for me, I have created a hbs-helper, which simple writes the property-name with the WriteSafeString-Method of the TextWriter.

Helper registration:

    public void ConfigureDesignTimeServices(IServiceCollection services)
    {
        var options = ReverseEngineerOptions.DbContextAndEntities;
        services.AddHandlebarsScaffolding(options);
        
        Handlebars.RegisterHelper("f-pn", FormatPropertyName);
    }

    void FormatPropertyName(TextWriter writer, object context, object[] args)
    {
        writer.WriteSafeString(args[0].ToString());
    }

Usage in templates:
{{f-pn property-name}}

I think, the property-name template should use the WriteSafeString-Method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions