1

I have a angular 7 project in that I have many html templates. In html templates where and I have inserted   its displayed as space along with another character "Â". This issue is not coming when I test in my local environment. When deployed in tomcat in my QA environment I am facing.

HTML Code
<!doctype html>
<html class="no-js" lang="en" dir="ltr">
<head>
    <base href="/">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Test</title>
<meta name="description" content="Description">
</head>
<body>
<jhi-root></jhi-root>
</body>
</html>

Next code snippet is one of the template I use in my project.

 <div class="d-flex" id="wrapper">
 <jhi-sidebar></jhi-sidebar>
 <div id="page-content-wrapper">
 <jhi-header></jhi-header>
 <div class="inner-page">
  <div class="container-fluid">
    <div class="row">
      <div class="col-12">
        <h3 class="card-title text-left">Widgets</h3>
      </div>
    </div>
  </div>
  <p> Link1 &nbsp; </p>
  <p> Link2 &nbsp; </p>
  <p> Link3 &nbsp; </p>
  </div>
  </div>
  </div>

Below is the output that is displayed when the above template is rendered. We can see that space is created but with extra special character not sure. Link1 Â Link2 Â Link3 Â

I have checked encoding type its UTF-8 but still I didnt understand why a weird character is displayed when rendered. Please help

Karthik
  • 470
  • 8
  • 25

1 Answers1

0

That'd be encoding to UTF-8 then, not ISO-8859-1. The non-breaking space character is byte 0xA0 in ISO-8859-1; when encoded to UTF-8 it'd be 0xC2,0xA0, which, if you (incorrectly) view it as ISO-8859-1 comes out as " "

Ref

Use

<meta charset="utf-8">
Derviş Kayımbaşıoğlu
  • 28,492
  • 4
  • 50
  • 72
  • You can see in my main html where angular templates are loaded. There I kept the code that you have mentioned but still no result as expected. – Karthik Sep 18 '20 at 05:16
  • what is the encoding of your source file? I mean your js file. – Derviş Kayımbaşıoğlu Sep 18 '20 at 05:59
  • UTF-8 is the encoding type – Karthik Sep 18 '20 at 06:09
  • I just would like to recheck what you did, you can use this post to check encoding of the file https://stackoverflow.com/a/13464816/1118978 If this is not the case then I suggest you to check your bundles encoding. – Derviş Kayımbaşıoğlu Sep 18 '20 at 06:19
  • Yes I checked the files as well as bundles all are saved in UTF-8 encoding only. And again I need to say this issue I am not experiencing in my local environment only when deployed in Tomcat in AWS – Karthik Sep 18 '20 at 06:59