Your best friend for file transfer.

Fetch application logoFetch

Commas being altered during FTP (10 posts)

  • Started 17 years ago by bryans
  • Latest reply 17 years ago from Scott McGuire
  • bryans Member

    I am using iWeb 1.1.1 and have had a problem when I use commas (') they appear on IE5 and Safari like this "Bryan’s" when it should be "Bryan's". Also paragraph spacers appear as  when I try to have a line between the paragraph.

    I have viewed the text via the view option and the HTML code has a single quote and a blank line where appropriate in it. The page is fine when the local published copy is viewed prior to FTP.

    Any suggestions.

    Posted 17 years ago #

  • Scott McGuire Administrator

    Hi,

    Could you give us a URL to a webpage that displays this problem so we could take a look at it and try to figure out what's going on?

    Also, what version of Fetch are you using?

    Thanks,

    Scott McGuire
    Fetch Softworks

    Posted 17 years ago #

  • bryans Member

    Scott

    Thanks for the reply/

    here is the link to one of my pages that is affected http://people.smartchat.net.au/~bryanhelen/Our_Site/The Big 40.html. There are other pages and texts that are affected as well.

    I tried wrapping the sentence in double quotes to see if that would fix the problem, but without success. I have also tried changing the encoding options to see if that can resolve it, but no success either. Currently back on Western ISO Latin 1.

    I am currently using Fetch 5.1, but had the same problem with 5.0.5.

    Hope you can help.

    Posted 17 years ago #

  • Scott McGuire Administrator

    Hi Bryan,

    Well, it appears that part of the problem is that iWeb creates webpages with curly quotes and other special characters, and does not use the HTML standard way to encode such special characters. The problem is these special characters are getting mangled to some other character on uploading.

    I believe your server is doing the modification, not Fetch (which is why none of the Fetch settings you've tried so far fix the problem).

    Could you try two things?

    First, re-upload one of the problem pages in Fetch, and then choose Fetch Transcript from the Window menu, copy the entire contents of the transcript window, and paste it here. That should give us some better idea of what the server is doing (and maybe we can figure out how to make Fetch tell the server to stop doing it).

    Next, make a connection, choose "Binary (Raw Data)" from the "Format" submenu of the "Remote" menu, and then try uploading your pages. Does that fix the problem?

    Thanks,

    Scott McGuire
    Fetch Softworks

    Posted 17 years ago #

  • bryans Member

    Scott

    I re-put the problem page as requested. here is the transcript window

    Fetch 5.1 (5B286) PowerPC running on Mac OS X 10.4.6 (8I127) PowerPC English
    StuffIt Engine 0x820, StuffIt SDK Version 10.1.1b1
    Partial serial FETCHEX001-JPMP-RC23 T
    Connecting to people.smartchat.net.au port 21 (OS X firewall is on) (29/6/06 4:58:43 PM)
    Connected to 203.63.81.8 port 21 (29/6/06 4:58:45 PM)
    220 FTP server ready.
    USER bryanhelen
    331 Please specify the password.
    PASS
    230 Login successful. Have fun.
    SYST
    215 UNIX Type: L8
    PWD
    257 "/"
    MACB ENABLE
    500 Unknown command.
    PWD
    257 "/"
    TYPE A
    200 Switching to ASCII mode.
    PASV
    227 Entering Passive Mode (203,63,81,8,68,216)
    LIST -al
    150 Here comes the directory listing.
    drwxr-x--- 3 155915 88 4096 Jun 26 13:40 .
    drwxr-x--- 3 155915 88 4096 Jun 26 13:40 ..
    drwxr-x--- 12 155915 88 4096 Jun 26 14:13 Our_Site
    226 Directory send OK.
    CWD Our_Site
    250 Directory successfully changed.
    PWD
    257 "/Our_Site"
    PASV
    227 Entering Passive Mode (203,63,81,8,69,230)
    LIST -al
    150 Here comes the directory listing.
    drwxr-x--- 12 155915 88 4096 Jun 26 14:13 .
    drwxr-x--- 3 155915 88 4096 Jun 26 13:40 ..
    -rw-r----- 1 155915 88 20695 Jun 26 13:55 April 2006.html
    drwxr-x--- 2 155915 88 4096 Jun 26 13:42 April 2006_files
    -rw-r----- 1 155915 88 14735 Jun 26 13:57 Cole on camera duties.html
    drwxr-x--- 2 155915 88 4096 Jun 26 13:44 Cole on camera duties_files
    -rw-r----- 1 155915 88 16806 Jun 26 13:59 Easter 2006.html
    drwxr-x--- 2 155915 88 8192 Jun 26 13:47 Easter 2006_files
    drwxr-x--- 2 155915 88 4096 Jun 26 13:47 Images
    -rw-r----- 1 155915 88 14559 Jun 26 14:01 Kids Together.html
    drwxr-x--- 2 155915 88 4096 Jun 26 13:52 Kids Together_files
    -rw-r----- 1 155915 88 10481 Jun 26 14:03 Rohan dancing.html
    drwxr-x--- 2 155915 88 4096 Jun 26 14:05 Rohan dancing_files
    -rw-r----- 1 155915 88 16708 Jun 26 14:05 Shots of the Boys.html
    drwxr-x--- 2 155915 88 8192 Jun 26 14:07 Shots of the Boys_files
    drwxr-x--- 2 155915 88 4096 Jun 26 14:08 SlideShow_assets
    -rw-r----- 1 155915 88 27184 Jun 27 14:19 The Big 40.html
    drwxr-x--- 2 155915 88 8192 Jun 26 14:13 The Big 40_files
    -rw-r----- 1 155915 88 10964 Jun 26 14:13 Welcome.html
    drwxr-x--- 2 155915 88 4096 Jun 26 14:13 Welcome_files
    -rw-r----- 1 155915 88 309 Jun 26 14:01 index.html
    226 Directory send OK.
    PASV
    227 Entering Passive Mode (203,63,81,8,69,17)
    STOR The Big 40.html
    150 Ok to send data.
    226 File receive OK.
    Transfer of The Big 40.html (27,184 bytes, 13,592 bytes/sec, 0:02 elapsed) completed at 29/6/06 4:59:24 PM
    PWD
    257 "/Our_Site"
    Update check started at 29/06/2006 05:00 PM

    Switched to Binary but made no difference. Reloaded pages each time. Thought about you comment on quotes and checked the preference of iWeb and the first one is "Automatic Correct Use Smart Quotes (""). I have tried with the box checked and unchecked but no difference.

    Posted 17 years ago #

  • Scott McGuire Administrator

    Hi Bryan,

    Thanks for the additional information. I've figured out what's going on. It turns out it's not a problem with the uploading in Fetch; it appears to be a problem with your web server.

    First an aside: unchecking the Smart Quotes checkbox in iWeb will only prevent new curly quotes from being created - it will not fix the curly quotes that are already there. You'd have to go back and fix all the ones that have been already created. But the curly quotes aren't the real problem here - I just used them as an example - so I'd leave the preference checked, and don't go back and fix the old ones.

    Next, some background on the problem. Most webpages have what's called a "character encoding" (also known as a "text encoding") which tells web browsers what character set the page is using, so that they can display the characters on the page properly. (This is particularly important if your webpage is written in a foreign language.) If you view the source of a webpage, you can usually see the character encoding listed as one of the first lines.

    Anyway, iWeb creates pages in the "UTF-8" character encoding, and properly labels them as such, which is good because they include things like the curly quotes that only display properly when using the UTF-8 encoding. The problem is that your webpage is being displayed by browsers as if it had a different character encoding, which makes some of the characters display incorrectly.

    If you go to your webpage in Safari, go to the View menu, go to the Text Encoding submenu, and choose UTF-8, your webpage will be redrawn and everything will display correctly. That's good, but not very helpful, because you don't want everyone to have to manually choose the encoding to see your pages correctly. (You haven't actually made a change to the webpage by choosing this option, you've only changed how Safari is currently displaying it.) However, this fact - along with the fact that when you view the text files with the View command in Fetch - shows that the files have actually be uploaded correctly. You don't need to mess around with uploading as Binary, as I suggested.

    The correct encoding should be being chosen automatically in Safari, since iWeb has correctly labelled your pages as UTF-8. (If a webpage does not list the encoding to use, that can lead to problems, but that's not what's going on here.) In fact, when I uploaded a copy of your webpage to my web server as a test, it displayed correctly automatically.

    So, I did some research and it turns out that some web servers force webpages to be displayed in a specific character encoding, regardless of what character encoding the webpages say they should be displayed with. I believe this is what your server is doing.

    You should contact the server administrator and/or hosting company and ask them to fix this problem. (You need to tell them that your pages specify a character encoding of UTF-8, but the web server is forcing them to be displayed as ISO Latin 1. Hopefully they'll understand. Don't let them tell you that you uploaded the files incorrectly; I can tell that you did not.) If they cannot or will not fix the problem, there is a possible workaround you might be able to do on your own which I can describe to you, but it would be much better if your web server was fixed.

    (And yes, there is a character encoding option in Fetch, as you noticed, but like Safari's "Text Encoding" menu, that option only changes how Fetch displays files and filenames - it does not actually change the contents of files at any point.)

    I hope this makes sense, and please let us know if you have further questions or need clarifications.

    Scott McGuire
    Fetch Softworks

    Posted 17 years ago #

  • bryans Member

    Scott

    Thanks for the explanation and the advice. Just rang my ISP and they wont change the encoding and only support (on my package) the most basic HTML.

    If, as you suggest I use UTF-8 as my Text encoding Viewing option it displays properly, but I have the same problem at work in IE6, so telling everyone to change it just for may pages is a bit rough.

    Could you tell me the other solution.

    Thanks

    Posted 17 years ago #

  • Scott McGuire Administrator

    That's too bad that they will not fix their server's misbehavior.

    Here's what to try, although it comes with a couple of caveats: (1) not all servers support this solution, so it may not work for you, and (2) creating it is a little tricky.

    You need to create and install an ".htaccess" file in your server directory. ".htaccess" files serve a variety of purposes on web servers, such as limiting access to your webpages, automatically redirecting you to another server, and more. They also allow you to specify a character encoding to override the server's default setting, which is what you want to do.

    An ".htaccess" file is just an ordinary plain text file named .htaccess . In it you should put one (and only one) of the following lines:

    AddDefaultCharset UTF-8

    AddCharset UTF-8 .html

    AddDefaultCharset Off

    Which one you need depends on your server; try the top one first, but then try the other two if it doesn't work. Only put one of those lines at a time in the .htaccess file.

    You need to use a program that saves plain text files to create this file (iWeb does not qualify). While you could use TextEdit, which comes with Mac OS X, there are several hoops you'd have to jump through to do that, so I recommend that you download a copy of TextWrangler from BareBones Software - it's is a good and free third-party text editor. Or if you have a different favorite text editor, use it.

    Also, the Mac OS X Finder will not show you files that begin with a period (and most programs will warn you about that when you try to create one that does), so be sure to remember where you saved this file so that you can find it again. The Fetch Put dialog will show you files beginning with a period if you check the "Show hidden files" checkbox in it.

    And be sure it is named ".htaccess" with no extension - ".htaccess.txt" won't work.

    Once you've created the file, use Fetch to upload it to the top level of your space on the server - it should not go inside the "Our_Site" folder.

    Then go to your webpage in Safari, choose View > Reload, and cross your fingers!

    Good luck, and let us know if you have any questions about the above.

    Scott McGuire
    Fetch Softworks

    [This message has been edited by ScottMcGuire (edited 06-30-2006).]

    Posted 17 years ago #

  • bryans Member

    Scott

    Tried those suggestions, but unforunatley they did not work.

    Tried usinng Text Wrangler to edit the HTML directly on my site. This worked, but when I reload my pages from iWeb any changes would be blown away. Not the ideal situation.

    However, I was having a look at other pages on my site and some of them had comma's and appeared OK. The only difference was that those that appeared OK had a shadow affect on them. So I have created another page to test this out. see http://people.smartchat.net.au/~bryanhelen/Our_Site/Fetch%20Test.html .

    If I don't put shadow affect on the comma's don't work. If I do they appear fine.

    Software, wwhat can you say.

    bryan

    Posted 17 years ago #

  • Scott McGuire Administrator

    Hi Bryan,

    The reason you don't see a problem with the quotes in shadowed text is that the shadowed text is actually an image (a PNG file), not plain text. When you ask for shadowed text, iWeb creates a graphic of the text, instead of saving it as plain text, and graphics are unaffected by character encodings and translation.

    As you've discovered, editing the files on the server isn't a good solution since you'd have to do it every time you changed a page.

    Since your hosting provider will not fix the problem and does not support the .htaccess override method either, unfortunately the only real way to solve the problem is to change servers and providers, or stop using iWeb for creating the webpages.

    There is no way to tell iWeb to stop creating webpages with the UTF-8 encoding (although you could send feedback to Apple suggesting they add that feature). At best you can minimize the problem by turning off smart quotes in the iWeb preferences, and then editing your pages in iWeb to replace the existing curly quotes with straight quotes (if you edit them in iWeb instead of the server, you won't have to keep redoing it after the first time). You're still going to run into problems with the spaces between the paragraphs and possibly other characters, though.

    Sorry, I wish I had a better answer for you.

    Best,

    Scott McGuire
    Fetch Softworks

    Posted 17 years ago #

Reply

  • Or nickname, if you prefer.
  • This will be kept confidential.
  • This is to ensure that you’re a person, not a spambot.