Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

PaperQueen

macrumors 6502
Original poster
Disclaimer: I am not a coder, so please be gentle. :eek:

I’m tweaking a custom.css file for use my blog (Thesis, for those who care). When I view it in TextEdit, TextMate, or GoLive, it looks fine. After it’s been uploaded to the server, apostrophes in web addresses turn to gibberish or question marks.

I’ve uploaded through both Fetch and GoLive. Fetch seems to produce question marks while GoLive substitutes “— gibberish.

Anyone have any insight to share? Can’t be the browser, since it appears the same in both Firefox and Safari, as well as to a third party offsite.

Help, please...?
 

SrWebDeveloper

macrumors 68000
Dec 7, 2007
1,871
3
Alexandria, VA, USA
Make sure you upload text files (source code/css) as ASCII and not binary. That's the very first thing you check. Also make sure you're saving the file as plane ASCII, not rich text. Questions marks mean certain characters could not be recognized within the default encoding. These are the common things to check.

Others here might offer additional advice so stay tuned.

-jim
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
Could potentially be a character set issue. Do you have a line in your code at the top resembling this,
HTML:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
The browser or the server may be misrepresenting the correct character set that was used when creating the page. This is a common issue that I see on many web sites.

Also, were you copying and pasting text from say MS Word, into your document? This can also create issues as there are different types of apostrophes and other symbols.
 

PaperQueen

macrumors 6502
Original poster
Make sure you upload text files (source code/css) as ASCII and not binary. That's the very first thing you check. Also make sure you're saving the file as plane ASCII, not rich text.

Hi Jim,

The way I’m going at this is to open the file from inside whatever editor is being used (File > Open), type in the changes, then save. Each of the three editors has retained the .css in the document name, so I know it’s not converting to rtf.

To upload, I’m simply dragging the document into Fetch, which then overwrites the existing file on the server.

How would I be able to tell if a file is being saved in ASCII versus binary? Wouldn’t binary show 1s and 0s when I looked at the newly saved (or downloaded from the server) file? Or am I being blind here?

Like I said....not a coder.....
 

PaperQueen

macrumors 6502
Original poster
Could potentially be a character set issue. Do you have a line in your code at the top resembling this,
HTML:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
The browser or the server may be misrepresenting the correct character set that was used when creating the page. This is a common issue that I see on many web sites.

Nope. No sign of the character set line anywhere in the file.

Also, were you copying and pasting text from say MS Word, into your document? This can also create issues as there are different types of apostrophes and other symbols.

Again, no. Wouldn’t go near Word for anything web related. Typically, I work in GoLive, but given this coding issue, I’m also trying to correct the problem in TextEdit and TextMate.
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
How would I be able to tell if a file is being saved in ASCII versus binary? Wouldn’t binary show 1s and 0s when I looked at the newly saved (or downloaded from the server) file? Or am I being blind here?

There's different definitions for binary. Yes, it can mean 1s and 0s, but also it refers to complex file formats that are not human readable, in contrast to a plain text file. You gave an example of what you saw, if everything looks like that it could be a binary vs ascii issue, but if it's just for a couple characters it's more likely a character set issue as I hinted to.

Since your page doesn't contain a tag saying what character set to use, let's give it one. First try the one I gave. If that doesn't help, try replacing ISO-8859-1 with UTF-8. Also, if you have a link it may be easier to diagnose. In your browser you can also try setting different character sets. In Firefox, if you go under the View menu you'll see a Character Encoding option. From there you can manually set different sets. Trying picking different ones to see if it clears up those odd characters. That'll tell you what your document is using.
 

PaperQueen

macrumors 6502
Original poster
Next chapter in this tale of pain....

Well, now I’m editing directly on the server through my cPanel, but still no luck. For some reason, the (fill in your favorite explative) quotation marks and apostrophes are going “smart,” tilting at angles rather than remaining plain and straight.

The host can go in and correct it on their end, but since I’m in the midst of designing a new blog on a subdomain, that could mean 25+ phone calls per day.

Anyone have a clue what the solution is for this? Have tried both Firefox and Safari, but that latter won’t even LET me edit the code. Very, very frustrating.
 

PaperQueen

macrumors 6502
Original poster
Since your page doesn't contain a tag saying what character set to use, let's give it one.

I don’t know if this makes a difference or not, but the file is custom.css, not a web page. By adding a tag calling out a character set, won’t I run the risk of the css not functioning properly (this is in Thesis for Wordpress, if that helps at all)?

Also, if you have a link it may be easier to diagnose.

I wish I did; since it’s not a page, but a css file, no clue what I could send.

In Firefox, if you go under the View menu you'll see a Character Encoding option. From there you can manually set different sets. Trying picking different ones to see if it clears up those odd characters. That'll tell you what your document is using.

Sadly, this didn’t make a difference. I opened up the code editing screen on my cPanel, then tried all four character sets listed in the Firefox View menu, typing quotation marks in each to see if one would stay straight. No luck. They all went “smart” (a word I’ve come to hate in the past 24 hours).
 

SrWebDeveloper

macrumors 68000
Dec 7, 2007
1,871
3
Alexandria, VA, USA
Attach the CSS file either zipped up or renamed with .txt on the end (i.e. Custom.css.txt). Then give us the link to any web page which is linking that file on the server. Armed with that, one of us will solve this issue.

-jim
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
I missed that is was a CSS file by itself. I thought is was the CSS inside and HTML file. Adding that tag won't make a difference of course then.

I figured it might be a smart quote issue (though forgot their name), but it's weird how they're popping in there. If you edit the file locally and use non-smart quotes, then upload that file through FTP, do the quotes get smartied? Apparently their cPanel wasn't setup to be the most helpful.

Edit: It's a WordPress issue. I found a plug-in that address modifying source code. This should be of help.
 

eskalation.dk

macrumors member
Oct 4, 2006
73
0
Hi,

i might be of help.

Your problem might be that your document is in encoded in ISO-8851 whereas it needs to be in UTF-8. It all depends on what the server wants and what you have set your document encoding to be.

It sounds to me like a mismatch. If your document is a UTF-8 and your <meta> tag says that the encoding is ISO, then your browser will try to enterprit the file as a ISO file, but the app will probably say that your file is whatever your file-setting is set to be. My advice is to go se what your file setting is in your local web editor.

What program do you use to edit your webfile?
 

PaperQueen

macrumors 6502
Original poster
Attach the CSS file either zipped up or renamed with .txt on the end (i.e. Custom.css.txt). Then give us the link to any web page which is linking that file on the server. Armed with that, one of us will solve this issue.

Here goes.... I just pulled this down from the server, so no clue if you’ll see straight apostrophes and quotes or if they’ll “go smart” again.

The page I’m working on is located on a subdomain (rather than drag my current blog viewers through the hell this has been to fix):
test.alwaysupward.com/wordpress

Thanks for staying with me on this one. Truth be told, if we could just find a way for me to edit the code through the browser, I’d be thrilled. Of the four named encoding options in Firefox (View > Character Encoding), none allow me to type straight apostrophes or quotes.

As mentioned earlier, Safari won’t allow me to edit on the server at all.
 

Attachments

  • custom.txt
    4.3 KB · Views: 117

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
I looked at the file with BBEdit, and I'm not seeing the smart quotes here. The file looks to be encoded using UTF-8, which is good. I looks like cPanel is just doing the harm. Do you have to use cPanel. What if you just directly FTP the file into place? Is that an option for you?
 

PaperQueen

macrumors 6502
Original poster
I looked at the file with BBEdit, and I'm not seeing the smart quotes here. The file looks to be encoded using UTF-8, which is good. I looks like cPanel is just doing the harm. Do you have to use cPanel. What if you just directly FTP the file into place? Is that an option for you?

That’s actually where the problem first cropped up. No matter how I get the file to the server, once it’s there, the server sees smart quotes. Even when I view the file through cPanel, there are smart quotes. No matter where I try to edit the file, there are problems.

As mentioned above, the file has been edited in three programs (TextEdit, TextMate, and GoLive). It’s been uploaded via GoLive and Fetch. In all cases, the server converts the file to smart quotes.

When editing in cPanel (> File Manager), the quotes and apostrophes I type appear as smarties.

I’ve tried editing in cPanel using Firefox (created smart quotes) and Safari (won’t allow me to edit).
 

PaperQueen

macrumors 6502
Original poster
I looked at the file with BBEdit, and I'm not seeing the smart quotes here. The file looks to be encoded using UTF-8, which is good. I looks like cPanel is just doing the harm. Do you have to use cPanel. What if you just directly FTP the file into place? Is that an option for you?

Also-—what you’re seeing is the corrected version that my webhost fixed. When they do it via Firefox (on PC) from their end, it works.

When I do it via Firefox on my Mac, it doesn’t work.

I haven’t touched the thing since they fixed the quotes, other than to test single quotes, then delete them when they continue to appear as smarties.
 

SrWebDeveloper

macrumors 68000
Dec 7, 2007
1,871
3
Alexandria, VA, USA
@OP:

Thanks for uploading the CSS file and sending us the link. I examined and the file is fine and your web page is indeed using the UTF-8 character set. However, I noticed one irregularity in your HTML that links this specific CSS file compared to the others:

HTML:
<link rel="stylesheet" href="http://test.alwaysupward.com/wordpress/wp-content/themes/thesis/custom/custom.css?013009-150143" type="text/css" media="screen, projection" />

Specifically I mean the "?013009-150143" argument appended on the end of the filename. You load other style sheets with the .php extension and various arguments which is perfectly legal (for those reading this not familiar with the concept, it's called dynamic CSS) and a few more with the .css extension without any argument since they're not dynamic, and no issues with any of those.

Interestingly, the custom.css validates fine with that argument or not.

So my advice is remove the "?013009-150143" on the end in the link tag calling custom.css and see if that improves the situation. It's just speculation at this point, but it appears the WordPress, encoding and editor related aideas posed by the group hasn't yet solved this issue so... WTF, why not try it? Worst thing that could happen is I'm wrong. I've been wrong before!

-jim
 

PaperQueen

macrumors 6502
Original poster
@ SrWebDeveloper

I don’t mean to be dense, but what file is that string in? I know you referred to the html file, but the only two files I’ve laid fingers on have been the custom.css and custom_functions.php. Anything else in the WP database is as originally written by the developer. The only html document I can find anywhere is the “read_me.html” which obviously wouldn’t be the ticket.

Since this bizarre smart quotes thing occurs everywhere-—on the test document (post #18), in the cPanel, and in all three text editors-—this appears to be the result of some hidden setting somewhere on my laptop. That’s the only common link other than the server, which the host is able to edit with straight quotes from their end (using a PC, crud).

Is that crazy? It’s definitely not driven by WP or the test document wouldn’t be doing this too, since it’s outside the WP folders.
 

SrWebDeveloper

macrumors 68000
Dec 7, 2007
1,871
3
Alexandria, VA, USA
What I was referring to was the link tag I found in the HTML source when I viewed source of the page you linked above: http://test.alwaysupward.com/wordpress/

It's probably in a WordPress template, but if you're not sure which file and you have a local copy on your Mac in "sites" use spotlight to find it or any find utility (look for any reference to "custom.css"). This might not solve your trouble, it was just an observation. Edit the template or whatever file has that link tag, remove the argument on the end, that's all I'm suggesting.

-jim
 

PaperQueen

macrumors 6502
Original poster
Surrender...and success

Based on angelwatt’s preferred use of BBEdit, I broke down and tried it (the fourth text editing option tried thus far...or was it fifth?). Thankfully, BBE has a drop down file option to whip quotes into shape (Text > Straighten quotes). Without it, I’d be in a heap.

Now...if I could only figure out why every third or fourth time I need to upload to the server BBE tells me it can’t due to a program error. Trading one frustration for another..........sigh.........

Thanks to everyone who swung at the fence on this one. You guys rock.
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
Now...if I could only figure out why every third or fourth time I need to upload to the server BBE tells me it can’t due to a program error. Trading one frustration for another..........sigh.........

Just saw that BBEdit released a new update (9.1.1), which reworked some issues with the S/FTP. The update may address the issue you were having. I've only rarely used that feature and didn't have problems personally, but obviously some people were since they reworked it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.