Sp chars (Spanish) not showing in placeholder

hi,

sp chars (Spanish) are not showing in placeholder… this

su correo electrónico

is showing as

su correo electrónico

I’m using this encoding…

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

using entity no. gives me same result:

su correo electr&#243;nico

how can I fix this, please…

thank you…

Not for me (using below code.)

<!DOCTYPE html>
<html lang="en">
<head>
  <meta content="IE=edge" http-equiv="X-UA-Compatible">
  <title>Test</title>
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <meta charset="UTF-8">
</head>
<body>
<p>su correo electrónico</p>
</body>
</html>

Is your editor set to utf-8?

thank you for your response… but the problem is only in placeholder text (you know, for forms, placeholder in text fields…) i.e.,

<input type="email" name="email" id="email" placeholder="su correo electr&#243;nico">

placeholder text should look like:

su correo electrónico

but it looks like this:

su correo electr&#243;nico

for all other situations, throughout the page (inside <p>'s, <div>'s, etc.), special chars look fine…

thank you…

thank you Ryan…

what is the solution? why can’t I get it to work?

I added

<meta charset="UTF-8">

in header… it still doesn’t work…:frowning:

thank you…

Which browser are you using? I can’t reproduce the issue here with Firefox or Chromium on Ubuntu Gnome. Have you validated your HTML?

In which browsers does this happen?
(Hi, TB )

happens on both Chrome & FF (am on mac, 10.6.8…)

& yes, I did validate the HTML, no errors (I posted the code of text field with the placeholder text earlier…)

thank you…

Did you check your editor charset? I’m just using the code you provided. Nothing crazy. I’m doing nothing different than you, other than probably having a properly set up editor.

what do you mean by “editor”??? HTML editor?

I’m using Dreamweaver, but I hand-code… does it make a difference in what HTML editor I write the code? :wink:
(and again: prob is only for placeholder text – elsewhere throughout the page sp chars look fine…)

I have this tag in header:

 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

and here’s code of text field with placeholder text:

 <input type="email" name="email" id="email" placeholder="su correo electr&#243;nico">

thank you…

Have you tried to use “electrónico” or “electrónico” instead?

If you’re using UTF-8, the character “ó” should exist

Notepad, Notepad++, Sublime, Dreamweaver. Whatever you use to code.

Nope. Up until a few months ago I was using Notepad.

Your editor replaces the spanish characters with that character code?

acutally yes, and that worked…:wink: I just thought it wasn’t proper form to do that… (but: because this text is actually in Javascript (I switch betw two languages)

   if (lang === 'es' ) { 
//   .........
yrEmail = 'su correo electr&#243;nico';
// ........
$('input#email').attr('placeholder',yrEmail);

// …
}

it’s not being accepted… you can’t put a “literal” letter w/an accent in a .js file… you get the “not proper encoding” alert… oh brother… ok… will have to switch languages differently on this one…

gotta go… thank you all very much for your help…

PS: but this

errEmail = 'favor poner su correo electr&oacute;nico';

for error msg works fine… again, prob is only for placeholder text…

So then maybe the problem is not in the HTML or the page coding itself but the JS? I guess you’re simply echoing the placeholder text?

no… as I mentioned… I’m doing JS for other content

errEmail = 'favor poner su correo electr&oacute;nico';

and it works fine… once again: problem with special chars is only for placeholder text (I also hard-coded it…

<input type="email" name="email" id="email" placeholder="su correo electr&#243;nico">

same problem…)

thank you…

Hm, works fine on my Mac, but that’s a fairly old OS you are using.

hi Ralph! :smile:

yes but surely this doesn’t have to do with OS version I’m running… it’s kind of old, but not that old, come on…:wink:

so: still no solution… to this odd problem…

thank you…

Using the straight é character works fine for me in JS, with no errors. But another option might be to use the escaped form of the é: i.e. \u00e9 in “su correo electr\u00e9nico”.

Working demo:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>

<input type="text" id="email">


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

<script>
	//var yrEmail = 'su correo electrénico';
	var yrEmail = 'su correo electr\u00e9nico';

	$('input#email').attr('placeholder',yrEmail);
</script>

</body>
</html>

thank you Ralph… that worked!!! :smile:

(however, I need an “ó”, not an “é”… can’t find a list of these escaped chars… tried \u00o9 instead of \u00e9, but got a JS error…)

found a list here, www.rgagnon.com/javadetails/java-0136.html
but doesn’t include an ó…:wink:

thank you very much…

O man, what an idiot I am. I got distracted and didn’t notice I’d picked the wrong letter. It was meant to be \u00f3.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>

<input type="text" id="email">


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

<script>
	//var yrEmail = 'su correo electrónico';
	var yrEmail = 'su correo electr\u00f3nico';

	$('input#email').attr('placeholder',yrEmail);
</script>

</body>
</html>