[Node.js] Implementing ° (degree symbol)

Hey guys,

I tried implementing ° (degree symbol) in my simple node.js project.

But it appears with a weird symbol °.

You can check the whole node.js source code on this link(It’s a cloud IDE) if you want.

When I run it on the cloud IDE, it appears normal without the  symbol.
( The weather in London is 14.02°C)

But when I run it on my local server with VS Code, it appears like this.
(The weather in London is 14.02°C)

How can I fix this problem/issue?

Thanks in advance for stopping by my question.

Hey there,

this seems like an encoding problem.
What happens when you run the app in another terminal, not in the VSCode one?

1 Like

Hello Michael! Thx for your response. I just got a solution from another dude.
All I have to do is just adding this

res.header(‘Content-Type’, ‘text/html; charset=utf-8’)

before ‘res.write(~~~)’ . But I think I should study what it is. Cuz even though I got a solution, I don’t understand how it works.

Hope this solution would help you too!