ESP32 web server display "£" problem

Capture

On my web page served by the ESP32 I want to use the pound currency symbol (£) in a paragraph, EG

cost in £


But when I do so I always see another strange character before the '£' something like an 'A' with an accent.
If I use the '$' instead symbol it works fine.
So how do I correctly display the '£' symbol in the web page?

Hi,

This is a problem I had myself a while back and never did get round to finding out so I just looked in to it and it looks like the trick is to send: £

lol - It definately works as I had trouble getting it not to display it here as a pound sign

See: HTML Symbols
and: Unicode Character Table - Full List of Unicode Symbols (◕‿◕) SYMBL

If you are sending the Content-Type header as text/html, add the charset so that the header line ends up as

Content-Type: text/html; charset=utf-8

If you not setting that header, try declaring the charset using a meta element. It is in the document head and has to be in the first 1024 bytes of the file.

<html>
  <head>
    <meta charset="utf-8" />
    <title>ESP32 web server display "£" problem</title>

The Pound sign is Unicode U+00A3. The UTF-8 encoding of that is two bytes

$ echo -n "£" | iconv -t utf-8 | hexdump -C
00000000  c2 a3

Looking at the most likely single-byte character set you're using by default, C2 is uppercase A-circumflex: Â -- yeah that looks like the one.

1 Like

That did the trick. Thanks

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.