I’m having an issue with the HTML form. When I type a text using accents and special characters like this:

r/webdev - <form> doesn't display accents (é, à, û, ü) and "ç" correctly

After clicking on “Submit”, I see the following result:

userName=Américo Vespúcio
userPhone= 44700000000
userMessage=Você está com o açúcar? [Portuguese]

Tu as déjà vu le travail d’un Développeur Web? Tu es sûr de ça? [French]

Kannst du die Türe schließen? [German]

This is my code:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <p>Contact form</p>

    <form action="" method="POST" enctype="text/plain">
      <input type="text" name="userName"/><br/>
      <input type="tel" name="userPhone"/><br/>
      <input type="email" name="userEmail"/><br/>
      <label>Your message:</label>
      <textarea name="userMessage" id="" cols="30" rows="10"></textarea><br/>
      <input type="submit"/>

Why am I having this problem if I’m using UTF-8 meta charset? And how can I solve this?

Source link

Write A Comment