charset

jaschulz
avatar
rank Regular

Regular


Posts: 39
Joined: 2006-04-12

The top of my html page looks like this:

WWReferences

body {
font-size: 11px;
font-family: sans-serif;
}

*****

Nevertheless, a server response (from dict.org) that includes accented (French) characers, looks like this:

1432, from M.Fr. t�m�rit� (15c.), from L. temeritatem (nom. temeritas) "blind chance,

What do I have to do to show these characters properly?

Thanks,

JAS

P.S. WinXP Pro SP2, FF2 (set to utf-8)

gary.turner
gary.turner's picture
rank Moderator

Moderator


Posts: 5959
Joined: 2004-06-25
Location: Dallas

Can you show us your exact

Can you show us your exact query?

Also, this does not appear to be a css question, so I'm moving it to 'off topic'.

cheers,

gary

A pianist who has learned the wrong system of fingering cannot become a virtuoso until he has laboriously taught himself the proper method.

My site is slo-o-owly being reconstructed; visit anyway.

jaschulz
jaschulz's picture
rank Regular

Regular


Posts: 39
Joined: 2006-04-12

First, two corrections: the

First, two corrections: the query was to etymonline.com, not dict.org as I said in my original message and the charset is iso-8859-1 and not UTF-8.

The query was:

http://www.etymonline.com/index.php?search=temerity&searchmode=term

The raw html_response is below: (the problematic characters, three e with acute acents, are about mid-way down)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Online Etymology Dictionary</title>
  <link rel="stylesheet" type="text/css" media="all" href="http://www.etymonline.com/style.css" />
  <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
</head>

<body>

<div id="container">
<div id="navigation">
  <div id="logo">
   <a href="http://www.etymonline.com/index.php" title="The Online Etymology Dictionary">
    <img src="http://www.etymonline.com/graphics/header.jpg"
         width="450" height="160"
         alt="The Online Etymology Dictionary"
         title="The Online Etymology Dictionary" />
   </a>
  </div> <!-- LOGO -->

  <form action="http://www.etymonline.com/index.php" method="get">
  <div id="search">
   Search:
   <input type="text" name="search" value="temerity" size="40" maxlength="255" />
   <select name="searchmode" size="1">
    <option value="none">Search Mode</option>
    <option value="nl">Natural Language</option>
    <option value="term" selected="selected">Find single term</option>
    <option value="or">Find any term</option>
    <option value="phrase">Find exact phrase</option>
   </select>
   <input type="submit" value="OK" />
  </div> <!-- SEARCH -->
  </form>

  <div id="browse">
  <ul>
   <li><a href="http://www.etymonline.com/index.php?l=a">A</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=b">B</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=c">C</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=d">D</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=e">E</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=f">F</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=g">G</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=h">H</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=i">I</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=j">J</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=k">K</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=l">L</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=m">M</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=n">N</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=o">O</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=p">P</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=q">Q</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=r">R</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=s">S</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=t">T</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=u">U</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=v">V</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=w">W</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=x">X</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=y">Y</a></li>
   <li><a href="http://www.etymonline.com/index.php?l=z">Z</a></li>
  </ul>
  </div> <!-- BROWSE -->
</div> <!-- NAVIGATION -->

  <div id="dictionary">
<dl>
<dt class="highlight"><a href="/index.php?term=temerity">temerity</a> <a href="http://dictionary.reference.com/search?q=temerity" class="dictionary" title="Look up temerity at Dictionary.com"><img src="graphics/dictionary.gif" width="16" height="16" alt="Look up temerity at Dictionary.com" title="Look up temerity at Dictionary.com" /></a></dt>
<dd class="highlight">1432, from M.Fr. <span class="foreign">t�m�rit�</span> (15c.), from L. <span class="foreign">temeritatem</span> (nom. <span class="foreign">temeritas</span>) "blind chance, accident, rashness," from <span class="foreign">temere</span> "by chance, blindly, casually, rashly," related to <span class="foreign">tenebrae</span> "darkness," from PIE base <span class="foreign">*temes-</span> "dark" (cf. Skt. <span class="foreign">tamas-</span> "darkness," <span class="foreign">tamsrah</span> "dark;" Avestan <span class="foreign">temah</span> "darkness;" Lith. <span class="foreign">tamsa</span> "darkness," <span class="foreign">tamsus</span> "dark;" O.C.S. <span class="foreign">tima</span> "darkness;" O.H.G. <span class="foreign">dinstar</span> "dark;" O.Ir. <span class="foreign">temel</span> "darkness").</dd>

</dl>
</div> <!-- DICTIONARY -->

<div id="google-adsense">
<script type="text/javascript"><!--
google_ad_client = "pub-7093273770345366";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "000000";
google_color_bg = "FFFBEC";
google_color_link = "300020";
google_color_url = "800020";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div> <!-- GOOGLE-ADSENSE -->

<div class="blank">&nbsp;</div>
<div id="footer">
  <ul id="links">
   <li><a href="http://www.etymonline.com/abbr.php" title="Introduction and abbreviations">Introduction and abbreviations</a></li>
   <li><a href="/columns/bio.htm" title="Who did this?">Who did this?</a></li>
   <li><a href="http://www.etymonline.com/working/deal.php" title="Sponsored Words">Sponsored Words</a></li>
   <li><a href="http://www.etymonline.com/columns/links.htm" title="Links">Links</a></li>
  </ul>
  <ul id="credits">
   <li>&copy; November 2001 <a href="mailto:byronic106@yahoo.com" title="E-mail Douglas Harper">Douglas Harper</a></li>
   <li><a href="http://www.logobee.com" title="Logo design by LogoBee.com">Logo design</a> by LogoBee.com</li>
   <li>Page design and coding by <a href="http://binrock.net/" title="Binary Rock">Dan McCormack</a></li>
  </ul>
  <div class="blank">&nbsp;</div>
</div> <!-- FOOTER -->
</div> <!-- CONTAINER -->
<!-- New site launched 20040911.1230 -->
<!-- Counter: 113741951 -->
<!-- Page was generated in 0.022754 seconds. -->
</body>
</html>

Thanks,

JAS

gary.turner
gary.turner's picture
rank Moderator

Moderator


Posts: 5959
Joined: 2004-06-25
Location: Dallas

This appears to be a result

This appears to be a result of the user configuration. Set the char encoding to auto rather than forcing utf-8. In FF2, with forced utf-8, I get your results. By configuring FF to auto-detect, I get a good rendering. See screen dump.

cheers,

gary

AttachmentSize
dump.jpg8.38 KB

A pianist who has learned the wrong system of fingering cannot become a virtuoso until he has laboriously taught himself the proper method.

My site is slo-o-owly being reconstructed; visit anyway.

jaschulz
jaschulz's picture
rank Regular

Regular


Posts: 39
Joined: 2006-04-12

I am not sure what you mean

I am not sure what you mean by setting FF2 to "auto" rather than forcing "UTF-8". It seems to me I have to do both because on my FF2 View | Character Encoding menu, Auto-Detect opens a sub-menu. On that submenu, I have "Universal" checked. However, on the main Character Encoding menu, below Auto-Detect (and a couple other choices) there is a bar and then five "radio" options (i.e. one of them must be checked). Of those five, I have UTF-8 is checked and, because it is a "radio" option, the only way I could uncheck it would be by checking one of the other four available encodings.

Is there somewhere else in FF2 to manipulate this setting?

Also, I should make clear that if I go to etymonline, the accented characters show as they should, but if I the scrape the html and put the result in a textarea, the accented characters are not properly shown. Rather they apear as they do in the code ... /code section of my previous message.

JAS

gary.turner
gary.turner's picture
rank Moderator

Moderator


Posts: 5959
Joined: 2004-06-25
Location: Dallas

I don't get your results.

I don't get your results. Open auto, and click on the top option.

cheers,

gary

A pianist who has learned the wrong system of fingering cannot become a virtuoso until he has laboriously taught himself the proper method.

My site is slo-o-owly being reconstructed; visit anyway.

jaschulz
jaschulz's picture
rank Regular

Regular


Posts: 39
Joined: 2006-04-12

Gary, If I may try your

Gary,

If I may try your patience one more time. Below is the code for an html page that will demonstrate my problem. Please copy and paste it and run it in FF2. Type "temerity" into the query field and press ENTER and you will see, I think, the character set problem in the result that is returned.

Thanks again,

JAS

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>WWReferences</title>

<style type="text/css">

body {
font-size: 11px;
font-family: sans-serif;
}

#queryField {
  padding-left: 2px;
margin-bottom: 7px;
border: 1px solid black;
}

#definitionTextArea {
  margin: 0px;
  padding: 2px;
font-size: 11px;
border: 1px solid black;
}

</style>

<script type="text/javascript">

var getNumber = 1;

function initialize() {
  reFocus();
}

function getContent() {
var q = document.getElementById('queryField').value;
var requestStr = 'http://www.etymonline.com/index.php?search='+q+'&searchmode=term';
ajaxGetFile(requestStr);
}

function showContent() {
document.getElementById('definitionTextArea').value += http_request.responseText;
}

function lookupOnEnter(evt) {
    evt = (evt) ? evt : event;
    var target = (evt.target) ? evt.target : evt.srcElement;
    var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13) {
getContent();
      return false;
    }
    return true;
}

function reFocus() {
  document.getElementById('queryField').focus();
}

var http_request=false;

  function ajaxGetFile(fileName) {

// running locally on IE5.5, IE6, IE7

if (location.protocol=="file:") { 

if (!http_request) try {
http_request=new ActiveXObject("MSXML2.XMLHTTP");
}catch(e){
http_request=false;
}

if (!http_request) try {
http_request=new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
http_request=false;
}
}

// IE7, Firefox, Safari, Opera...

if (!http_request) try {
http_request=new XMLHttpRequest();
} catch(e) {
http_request=false;
}

// IE6

if (typeof ActiveXObject != "undefined") {
if (!http_request) try {
http_request=new ActiveXObject("MSXML2.http_request");
} catch(e) {
http_request=false;
}
if (!http_request) try {
http_request=new ActiveXObject("Microsoft.http_request");
} catch(e) {
http_request=false;
}
}

// IceBrowser

if (!http_request) try {
http_request=createRequest();
} catch(e) {
http_request=false;
}

if (window.XMLHttpRequest) { // Mozilla, Safari,...
      //http_request = new XMLHttpRequest();
      if (http_request.overrideMimeType) {  http_request.overrideMimeType('text/xml');  }
}

    if (!http_request) {
      alert('ERROR: Cannot create an XMLHTTP instance');
      return false;
    }
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    http_request.onreadystatechange = function() { ajaxContent(); }
    http_request.open('GET', fileName, true);
    http_request.send(null);
}

  function ajaxContent() {
    if (http_request.readyState == 4) {
      if (http_request.status == 200 || http_request.status == 0) {
showContent(http_request.responseText);
      } else {
alert('Error: Code(' + http_request.status + ')');
      }
    }
}

</script>

</head>

<body onload="initialize();" ondblclick="gS();" >

<p><input id="queryField" type="text" onkeypress="return lookupOnEnter(event)" onfocus="select()" ></input></p>
<p><textarea id="definitionTextArea" cols="80" rows="25"></textarea></p>

</body>

</body>

</html>

gary.turner
gary.turner's picture
rank Moderator

Moderator


Posts: 5959
Joined: 2004-06-25
Location: Dallas

Sorry, I can't do anything

Sorry, I can't do anything with it. In Firefox2, Win and Linux, I get an error:

uncaught exception: A script from "http://koko" was denied UniversalXPConnect privileges.

In IE7, I get error.

In Firefox3 in Win, nothing happens.

cheers,

gary

A pianist who has learned the wrong system of fingering cannot become a virtuoso until he has laboriously taught himself the proper method.

My site is slo-o-owly being reconstructed; visit anyway.