1

I have some product descriptions on my website that for some reason are getting (what I found online) unicode substitutions instead of the value of the string. for example, one of my product desc starts off with 5 inch round window ..., however, on the website, it is actually showing up 5◆ round window, and in my logs, I get 5\u001a round window .... does anyone know why this could be happening??

note: im using ejs front end framework

Gianluca
  • 900
  • 8
  • 27
  • Do you have a `meta` element with a `charset` attribute on your page? It will be ` ... `. You might be using a unicode character that isn't supported by the character set encoding you have selected (or not selected). A common charset encoding is "UTF-8". – Matt Jan 12 '21 at 03:00
  • yes, I have this: `` in there. thought this would work, but still getting the `5\u001a round window ...` in there – Gianluca Jan 12 '21 at 03:01
  • Read this [similar question](https://stackoverflow.com/questions/4696499/meta-charset-utf-8-vs-meta-http-equiv-content-type). Is your charset declaration the first meta tag in the head element? It's supposed to be as early in your document as possible, not buried beneath a bunch of link tags, etc. – Matt Jan 12 '21 at 03:08
  • @Matt I replaced `` with ` ` and still the same issue... super strange, not sure why still happening – Gianluca Jan 12 '21 at 03:10
  • 2
    Some [more research](https://stackoverflow.com/questions/17024436/what-is-the-unicode-u001a-character-aka-0x1a) indicates that `\u001a` is a control character that has no character representation. So do you just have a rogue character in your document? Cheer up, use Google :) – Matt Jan 12 '21 at 03:11
  • ill have to research more, but basically I am calling the string through ejs, so I am not actually hard coding the string value into the html page, I am calling it from my db. thought that may be an issue, but cant find anything stating so!! – Gianluca Jan 12 '21 at 03:14

0 Answers0