Blazor – Correcting Special Character Problems in the Toolbelt.Blazor.I18nText Library

Blazor used to not have official Localization support (which can help us for tasks like having an app in several languages), so we used libraries like Toolbelt.Blazor.I18nText to have multi-language support. Although this is no longer necessary, since new versions of Blazor have official Localization support, some applications are already made with Toolbelt.Blazor.I18nText anyway.

A recurring problem that some people may encounter with Toolbelt.Blazor.I18nText is that JSONs that contain special characters, such as the ñ and accent marks, appear with errors.

The error is due to encoding of JSON files. Here is the solution:

– Open the JSON that has the error in Visual Studio

– Go to File> Save {File name} as …

– Click Save with Encoding:

encoding1

– Say you want to replace the file

– Select the appropriate encoding for your situation. In my case I have solved the problem with “Unicode (UTF-8 with signature)“.

That’s it!

Course

If you want a course where we develop a Blazor project step by step from scratch to production, purchase my course today:

https://www.udemy.com/course/programming-in-blazor-aspnet-core/?referralCode=8EFA9D9FF38E3065DF0C

Regards!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s