Hindi text is shown as unreadable code after deploying from github repo

Ashish Vishwakarma 20 Reputation points
2023-10-28T06:59:29.1233333+00:00

My github repo has text "हिंदी Test", which is being deployed to Azure Static Web App after deployment text is visible as "हिंदी Test".

At the time of committing file encoding was UTF8. In GitHub repo Hindi text is visible but some encoding or something is changed, and hindi text is not getting rendered properly.

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,181 questions
{count} votes

Accepted answer
  1. suraj sharma 85 Reputation points
    2023-10-28T10:59:57.7433333+00:00

    This issue might be due to the encoding settings of your Azure Static Web App. Here are a few things you can try:

    File Encoding: Ensure that the file containing the text “हिंदी Test” is saved with UTF-8 encoding. In many text editors, you can do this by going to File => Save As => Save with Encoding and choose Unicode (UTF-8 With Signature).

    This tag specifies that the content of the file is encoded in UTF-82.

    URL Encoding: If the issue persists, you might need to URL encode your string. For example, in JavaScript, you can use encodeURIComponent("हिंदी Test") to encode your string.

    Remember to redeploy your web app after making these changes. If the issue still persists, please provide more details about your setup and I’ll do my best to assist you further.

    Meta Tag: Check if you have the following line in the head section of your HTML file:

    HTML
    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.