Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q100 How can I add diacritical letters such as è to a textarea?

You are here: irt.org | FAQ | JavaScript | Text | Q100 [ previous next ]

Egrave -- capital E, grave accent -- È -- è -- %C8

è is itself a HTML variable that when rendered will convert to a capital E grave accent character. However textareas will NOT render HTML.

Using JavaScript you can create the appropriate ASCII character code using hexidecimal characters and the unescape() function:

<form name="test">
<textarea name="output" cols="16" rows="62">
</textarea>
</form>

<script language="JavaScript"><!--
var output = '';
output += 'Agrave ' + '192 ' + 'C0 ' + unescape('%C0') + '\n';
output += 'Aacute ' + '193 ' + 'C1 ' + unescape('%C1') + '\n';
output += 'Acirc  ' + '194 ' + 'C2 ' + unescape('%C2') + '\n';
output += 'Atilde ' + '195 ' + 'C3 ' + unescape('%C3') + '\n';
output += 'Auml   ' + '196 ' + 'C4 ' + unescape('%C4') + '\n';
output += 'Aring  ' + '197 ' + 'C5 ' + unescape('%C5') + '\n';
output += 'AElig  ' + '198 ' + 'C6 ' + unescape('%C6') + '\n';
output += 'Ccedil ' + '199 ' + 'C7 ' + unescape('%C7') + '\n';
output += 'Egrave ' + '200 ' + 'C8 ' + unescape('%C8') + '\n';
output += 'Eacute ' + '201 ' + 'C9 ' + unescape('%C9') + '\n';
output += 'Ecirc  ' + '202 ' + 'CA ' + unescape('%CA') + '\n';
output += 'Euml   ' + '203 ' + 'CB ' + unescape('%CB') + '\n';
output += 'Igrave ' + '204 ' + 'CC ' + unescape('%CC') + '\n';
output += 'Iacute ' + '205 ' + 'CD ' + unescape('%CD') + '\n';
output += 'Icirc  ' + '206 ' + 'CE ' + unescape('%CE') + '\n';
output += 'Iuml   ' + '207 ' + 'CF ' + unescape('%CF') + '\n';
output += 'ETH    ' + '208 ' + 'D0 ' + unescape('%D0') + '\n';
output += 'Ntilde ' + '209 ' + 'D1 ' + unescape('%D1') + '\n';
output += 'Ograve ' + '210 ' + 'D2 ' + unescape('%D2') + '\n';
output += 'Oacute ' + '211 ' + 'D3 ' + unescape('%D3') + '\n';
output += 'Ocirc  ' + '212 ' + 'D4 ' + unescape('%D4') + '\n';
output += 'Otilde ' + '213 ' + 'D5 ' + unescape('%D5') + '\n';
output += 'Ouml   ' + '214 ' + 'D6 ' + unescape('%D6') + '\n';

output += 'Oslash ' + '216 ' + 'D8 ' + unescape('%D8') + '\n';
output += 'Ugrave ' + '217 ' + 'D9 ' + unescape('%D9') + '\n';
output += 'Uacute ' + '218 ' + 'DA ' + unescape('%DA') + '\n';
output += 'Ucirc  ' + '219 ' + 'DB ' + unescape('%DB') + '\n';
output += 'Uuml   ' + '220 ' + 'DC ' + unescape('%DC') + '\n';
output += 'Yacute ' + '221 ' + 'DD ' + unescape('%DD') + '\n';
output += 'THORN  ' + '222 ' + 'DE ' + unescape('%DE') + '\n';
output += 'szlig  ' + '223 ' + 'DF ' + unescape('%DF') + '\n';
output += 'agrave ' + '224 ' + 'E0 ' + unescape('%E0') + '\n';
output += 'aacute ' + '225 ' + 'E1 ' + unescape('%E1') + '\n';
output += 'acirc  ' + '226 ' + 'E2 ' + unescape('%E2') + '\n';
output += 'atilde ' + '227 ' + 'E3 ' + unescape('%E3') + '\n';
output += 'auml   ' + '228 ' + 'E4 ' + unescape('%E4') + '\n';
output += 'aring  ' + '229 ' + 'E5 ' + unescape('%E5') + '\n';
output += 'aelig  ' + '230 ' + 'E6 ' + unescape('%E6') + '\n';
output += 'ccedil ' + '231 ' + 'E7 ' + unescape('%E7') + '\n';
output += 'egrave ' + '232 ' + 'E8 ' + unescape('%E8') + '\n';
output += 'eacute ' + '233 ' + 'E9 ' + unescape('%E9') + '\n';
output += 'ecirc  ' + '234 ' + 'EA ' + unescape('%EA') + '\n';
output += 'euml   ' + '235 ' + 'EB ' + unescape('%EB') + '\n';
output += 'igrave ' + '236 ' + 'EC ' + unescape('%EC') + '\n';
output += 'iacute ' + '237 ' + 'ED ' + unescape('%ED') + '\n';
output += 'icirc  ' + '238 ' + 'EE ' + unescape('%EE') + '\n';
output += 'iuml   ' + '239 ' + 'EF ' + unescape('%EF') + '\n';
output += 'eth    ' + '240 ' + 'F0 ' + unescape('%F0') + '\n';
output += 'ntilde ' + '241 ' + 'F1 ' + unescape('%F1') + '\n';
output += 'ograve ' + '242 ' + 'F2 ' + unescape('%F2') + '\n';
output += 'oacute ' + '243 ' + 'F3 ' + unescape('%F3') + '\n';
output += 'ocirc  ' + '244 ' + 'F4 ' + unescape('%F4') + '\n';
output += 'otilde ' + '245 ' + 'F5 ' + unescape('%F5') + '\n';
output += 'ouml   ' + '246 ' + 'F6 ' + unescape('%F6') + '\n';

output += 'oslash ' + '248 ' + 'F8 ' + unescape('%F8') + '\n';
output += 'ugrave ' + '249 ' + 'F9 ' + unescape('%F9') + '\n';
output += 'uacute ' + '250 ' + 'FA ' + unescape('%FA') + '\n';
output += 'ucirc  ' + '251 ' + 'FB ' + unescape('%FB') + '\n';
output += 'uuml   ' + '252 ' + 'FC ' + unescape('%FC') + '\n';
output += 'yacute ' + '253 ' + 'FD ' + unescape('%FD') + '\n';
output += 'thorn  ' + '254 ' + 'FE ' + unescape('%FE') + '\n';
output += 'yuml   ' + '255 ' + 'FF ' + unescape('%FF');

document.test.output.value = output;

//--></script>

Feedback on 'Q100 How can I add diacritical letters such as è to a textarea?'

©2018 Martin Webb