Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Bug in Code or on Server? is that possible?

  1. #1
    Join Date
    May 2007
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Bug in Code or on Server? is that possible?

    1) Script Title: Scrollable Content 11

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm

    3) Describe problem: Four months ago I created a site which uses Scrollable content script II. It worked great until a few weeks ago when it started changing to Japanese. I have no idea why. It works for a couple of days after reposting then changes. Could it be a bug on the server or is it something in the code? Please help.
    The page in question is: http://petersearle.com/list.html

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    More like Chinese

    Anyway, it's probably just the browser's content-type autodetection fouling up on something. Apply a proper content-type with a charset to both pages and all should be OK.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    May 2007
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Twey. Thanks for your help but I'm afraid its still all Greek to me. I thought it did have a "proper content-type with a charset"? I have noticed some strange text appearing in the copyright notice. Is it possible for added volume on the page to effect it? I will change it again and hope for the best. In the meantime here is the weird text:

    <!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" lang="en" xml:lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>peter searle::archive</title>
    <link rel="stylesheet" type="text/css" href="main.css" />

    <style type="text/css">
    table.one
    {
    table-layout: fixed;
    }

    #loadarea {
    font-family:Arial, Helvetica,sans-serif;
    }
    #loadarea img {
    font-family:Arial, Helvetica,sans-serif;
    border:1px solid #999;
    background: #fff;
    padding:0.2em;
    }


    </style>

    <script type="text/javascript" src="thumbnailviewer2.js" defer="defer">

    /***********************************************
    * Image Thumbnail Viewer II script- ?0?10?0?110?0?10?0?148 Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    </script>

    <body>
    <div id="maincontainer">
    <div id="topsection"> <img border="0" src="images/name.gif" alt=""/></div>
    <div id="contentwrapper">
    <div id="loadarea" style="width: 605px" "height:690px"><img border="0" src="images/alex_connock.jpg" alt=""/>
    <div class="innertube"> <b> <em></em></b></div>
    </div>
    </div>

    <div id="leftside">
    <script type="text/javascript">

    /******************************************
    * Scrollable content script II- ?0?10?0?110?0?10?0?148 Dynamic Drive (www.dynamicdrive.com)
    * Visit http://www.dynamicdrive.com/ for full source code
    * This notice must stay intact for use
    ******************************************/

    iens6=document.all||document.getElementById
    ns4=document.layers

    //specify speed of scroll (greater=faster)
    var speed=5

    if (iens6){
    document.write('<div id="container" style="position:relative;width:385px;height:610px;border:0px solid black;overflow:hidden">')
    document.write('<div id="content" style="position:absolute;width:385px;left:0;top:0">')
    }
    </script>

    <ilayer name="nscontainer" width=385 height=460 clip="0,0,175,160">
    <layer name="nscontent" width=385 height=460 visibility=hidden>



    <!--INSERT CONTENT HERE-->
    <table class="one" border="0" width="100%">

    <tr>
    <td width="40%">Akbal Mohamed Popal</td><td width="60%"> Vice Chancellor of Kabul University</td> </tr>

    <tr><td width="40%">Alan Bradley</td><td width="60%">The Wellcome Trust, The Sangar Centre</td> </tr>


    <tr><td width="40%">Alan Johnson MP</td><td width="60%">The Secretary of State for Health</td> </tr>

    <tr><td width="40%">Albert Roux</td><td width="60%"> Chef, Le Gavroche. </td> </tr>
    <tr><td width="40%"></td><td width="60%">Recipient Legion d'honneur</td> </tr>

    <tr><td width="40%"><a href="images/alex_connock.jpg" onclick="return false;" style="loadarea img" rel="enlargeimage::click" rev="loadarea" class="noborder"/>Alex Connock</a></td><td width="60%">Ten Alps (co-founder with Sir Bob Geldof)</td> </tr>

    <tr><td width="40%"><a href="images/andrea_bocelli1.jpg" onclick="return false;" style="loadarea img" rel="enlargeimage::click" rev="loadarea" class="noborder"/>Andrea Bocelli</a></td><td width="60%">Tenor</td> </tr>

    <tr><td width="40%"> Andrew Dilnot CBE</td><td width="60%">Principal, St Hughes Coll., Oxford / </td> </tr>

    <tr><td width="40%"></td><td width="60%">documentary presenter</td> </tr>

    <tr><td width="40%"> Andrew Winter</td><td width="60%">TV presenter, Selling Houses etc.</td> </tr>

    <tr><td width="40%"><a href="images/andy_burnham.jpg" onclick="return false;" style="loadarea img" rel="enlargeimage::click" rev="loadarea" class="noborder"/>Andy Burnham MP</a></td><td width="60%">Chief Secretary to the Treasury</td> </tr>

    <tr><td width="40%"><a href="images/andy_harrison.jpg" onclick="return false;" style="loadarea img" rel="enlargeimage::click" rev="loadarea" class="noborder"/>Andy Harrison</a></td><td width="60%">CEO of Easyjet</td> </tr>

    <li<tr><td width="40%"><a href="images/andy_sanders.jpg" onclick="return false;" style="loadarea img" rel="enlargeimage::click" rev="loadarea" class="noborder"/>Andy Sanders</td><td width="60%">Co-Founder of the Puccino's franchise</a></td> </tr>

    <tr><td width="40%"> Angela Huth</td><td width="60%"> Novelist </td> </tr>

    <tr><td width="40%"><a href="images/anita_rodick.jpg" onclick="return false;" style="loadarea img" rel="enlargeimage::click" rev="loadarea" class="noborder"/>Anita Rodick (1942-2007)</td><td width="60%">Founder of The Body Shop</a></td> </tr>

    <tr><td width="40%"><a href="images/anne-marie_duff.jpg" onclick="return false;" style="loadarea img" rel="enlargeimage::click" rev="loadarea" class="noborder"/>Anne-Marie Duff</td><td width="60%">Actress</a></td> </tr>

    <tr><td width="40%"><a href="images/anthony_horowitz.jpg" onclick="return false;" style="loadarea img" rel="enlargeimage::click" rev="loadarea" class="noborder"/>Anthony Horowitz</td><td width="60%">Childrens author</a></td> </tr>
    ?tr><td width="40%"><a href="images/anthony_k???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????</td><td width="60%">P??????????????????????????? ??????????????????



    And so on..........

    Many Thanks.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You have:

    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    on the page, but the server is serving it using UTF-16. Twey would know more about why that's messing things up and how to change it than I do though.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    May 2007
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmm. You have me really confused now John. Should I be using a different "Content-Type" or charset? And should I be saving my codes in UTF-16, UTF-8, or western (mac OS roman)? I have never considered this bit before.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I had hoped Twey would have come back to this thread, but so far he hasn't. As I said, he would know more about it. I usually stick to the client side.

    However, I can say that your meta http-equiv="Content-Type" tag is being overridden by the server as UTF 16. That much is clear. Now, from what I can tell from Googling UTF 16, it will cause some characters to be served with some of their bits removed.

    Here's where I get a little sketchy, I'm not sure if even charset=iso-8859-1 is what you want, but I know it should be better than UTF 16 for your content. There might be a better one though. So, that needs to be determined, and then, whatever charset is optimal needs to be configured on the server side, or, at the very least, the server needs to be configured to allow your meta http-equiv="Content-Type" tag to set the content type and that should then be set to the optimal charset.

    How this (configuring the server) is done is just a bit beyond me though. There are several methods, hopefully you are familiar with one of them. If not, you can ask your host, or if you are hosting your own site, read up on the server software you are using's configuration.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Hmm. I'm a little unsure of what to do here (or indeed what's happened to result in this situation) since it appears that all the rest of the file is valid UTF-16 except for that bit at the bottom (and bits of the DD copyright notices). How did you create this file?

    Converting the whole thing to UTF-8 would probably better since your text is mostly Western -- UTF-16 requires two bytes for everything, but UTF-8 requires only one byte for ASCII-compatible text (at the expense of an extra byte per CJK character).
    Last edited by Twey; 12-10-2007 at 10:25 AM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Another possibility is that the file itself is corrupt. Was it your intention to include all of those Asian characters?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'd suggest making a new file, and cutting/pasting any GOOD chunks and leaving any corrupt bits in first file, rewriting them.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  10. #10
    Join Date
    May 2007
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK you guys have really blinded me with science now. I'm a little out of my depth but I think we are making progress. I can safely say that there is not meant to be any Chinese.
    The original file was created by me using text edit on a mac. Im not sure if I saved as western mac roman, utf-16 or utf-8 . I now know that the owner of the site has recently added images/lines to it himself on a mac and i suspect saved it using utf-16. I guess this explains the reason that some of it still works and some doesn't.
    1.What should it be written and saved in (western mac roman, utf-16 or utf-8)?
    2.And also should it be rich or plain text? I think the problem may be simply that I dont understand these options.

    Thanks Heaps Guys.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •