PDA

View Full Version : Back to Mac from PC, HTML/PHP Editing Options?


Mr Ten
2005-12-01, 05:39
I used to use Notepad on PC to program php and html, now using text edit.

In various instances (ie: e-marketing items), when special characters are pasted into TextEdit (extended hyphens, smart "quotation" marks and apostrophes) and then uploaded to a server, they can appear to be either errors / gray blocks, or disappear all together. Also, you can't view the source of the file online (on a PC that is).

What's recommended as far as an editor that can help clean this up and ensure that everyone is seeing things properly? I did a 2 second glance and saw Mozilla suite and TacoHTML, didn't get them yet. I also have CS2 Premium so I have GoLive, if that helps. Please advise.

Thanks for you help! :)

...running new osx on a dual-core 2ghz ( not a quad whore ;) )

Brad
2005-12-01, 05:46
special characters ... (extended hyphens, smart "quotation" marks and apostrophes) ... can appear to be either errors / gray blocks, or disappear all together.BAD! *smack*

The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) (http://www.joelonsoftware.com/articles/Unicode.html)

W3C's HTML Document Representation (http://www.w3.org/TR/html4/charset.html)

AsLan^
2005-12-01, 06:38
Textwrangler might have the features you are looking for (something about converting to ASCII). I don't know enough about web publishing to comment on the rightness or wrongness of using proper codepages and I usually just go with the flow.

It seems to me that the preferred editors are jEdit and Textwrangler.

Brad
2005-12-01, 06:49
I think AsLan^ needs to read that bold link too. :)

AsLan^
2005-12-01, 06:58
I think AsLan^ needs to read that bold link too. :)

I did ! :) (before posting even)

It was a very engaging article but at the end it seemed the author was saying make sure your html has encoding tags and if you are creating an app that parses text, be sure to remember that these days not all text is ascii.

I've had problems editing a text document in textedit, cutting and pasting it into a shell only to find that it's no longer "plaintext" anymore. Which is a little irritating.

EDIT: I just tried to replicate my previous experience with textedit and couldn't so I guess I've got the circumstances wrong. But I remember I did have a problem cutting and pasting with textedit once.

Brad
2005-12-01, 07:22
I've had problems editing a text document in textedit, cutting and pasting it into a shell only to find that it's no longer "plaintext" anymore. Which is a little irritating.
Then you forgot this little tidbit:
be sure to remember that these days not all text is ascii.:)

That applies everywhere, not just in web browsers. What's special about web pages is that you can explicitly define the character set after it has started to load by the browser. Other applications that accept outside input either use only a default encoding (bad!), try a "best guess" (like some web browsers), or allow the end user to define the character set.

The Terminal app? Yup, it allows you to choose the character set encoding. If it matches the character set of the text you copied from TextEdit, it should paste just fine. Otherwise, what TextEdit thinks is an "A" Terminal might, for instance, think is a "Ł" or a "ȉ" or a "" or some other entity.

AsLan^
2005-12-01, 07:57
I hadn't realized that terminal had an encoding setting!

BTW I was able to replicate the problem I had before but I really don't know if it's encoding related because all the character should be in the 32-128 character set.

Not that this requires any troubleshooting or anything because I was just cutting a song out of a webpage to use as example text for some project I was working on.


http://catnipcomputer.net/catnip/examplesmall.png (http://catnipcomputer.net/catnip/examplebig.png)

ast3r3x
2005-12-01, 08:08
I guess this really requires proper HTML, but John Gruber from daringfireball.net (http://daringfireball.net/projects/) has an addition to BBEdit that helps with quotation and such.

I'm referring to SmartyPants by the way.

Edit: I guess it also requires BBEdit :p

drewprops
2005-12-01, 09:47
Only a matter of time before someone lets on about SubEthaEdit (http://www.codingmonkeys.de/subethaedit/). Let's see how long it takes before somebody tells you about that one.

Yep. Let's see.


Edit: Oh wait, it has collaborative features as well?? Hmmmmm....

rollercoaster375
2005-12-01, 10:00
1. SubEthaEdit
2. Sumultron
3. TextMate
4. BBEdit
5. Text Wrangler

There are others, but those are the decent ones. (Not including Java Apps)

Brad
2005-12-01, 11:17
Since I didn't mention it before, I'll repeat the recommendation of the last two members. I use SubEthaEdit for the overwhelming majority of my coding. AppleNova? Yeah, all the HTML and CSS you see here that I've written or modified was done through SubEthaEdit.

SubEthaEdit is pretty feature-light, but that's why I like it. It's a simple text editor at the core, but it offers line and character numbering, syntax coloring, automatic line indention, bracket/parenthesis matching, and collaborative sharing/editing (although, I've never used this bit).

SubEthaEdit also plays very nicely with the smart FTP/SFTP clients like Transmit and Fugu that allow you to edit the file "directly" on the server. When I click "edit externally" in Transmit, for example, it downloads the file to a hidden temporary directory and opens it in SubEthaEdit. Any time I choose to save it, SubEthaEdit notified Transmit to upload and replace the old copy. I love that.

I don't like editors that try too hard to do my job. I especially hate editors that automatically insert an additional quote or parenthesis or bracket in anticipation of my next move. I already have the well-practiced memory muscle that instinctively taps return a few times, enters a closing parenthesis, and arrows back up, thankyouverymuch.

rollercoaster375
2005-12-01, 13:39
Automatic line indentation isn't as nice as it could be in most OS X programs. When working on a windows box, I use Maguma Open Studio. When you hit a close curly bracket the tab level goes down one. Saves quite a large amount of time.

(Side note, I use SubEthaEdit for the majority of my work, although not with the default syntax highlighting)

Mr Ten
2005-12-01, 21:00
i hate editors and want something feature light. the syntax coloring, proper character display and line #'s are more than enough, i will try subetha out. thanks for the help, i really could've used it in today's hectic times of preparing 6 email campaigns being sent to 10 different lists! :eek:

Mr Ten
2005-12-07, 20:29
text wrangler is what i'm using for now.

it cuts / pastes as is.
it straightens smart-quotes and apostrophes
it has the ascii table for me to find/replace items easy.

i thought i saw a table that shows a project outline (maybe another one?)

good for now, nice and simple.

thanks very much.

Radarbob
2005-12-18, 17:29
I'm surprised BBEdit has not gotten more mention.

As a programmer's editor, BBEdit is peerless.

I code on PCs for a living and at one point I was bringing in my macintosh to use BBEdit for it's HTML capabilities. I particularly like how it can match html tags. Of course I did not ask permission to do this. :D