Posts Tagged ‘Expression Web’

BOM, UTF - WTF?!

Tuesday, October 16th, 2007

BOM=Byte Order Mark
UTF= Uniform Transformation Format
WTF?! = well, you know…

Whatever happened to just plain old ASCII text?
OK, so UTF is ASCII text, but why in the world would you want HIDDEN characters in your files? Especially if there’s no way to toggle displaying them or not. Thank goodness for good old DOS EDIT.

In my last post I mentioned the problems I had with installing Wordpress on my domain. The culprit was the BOM at the beginning of the wp-config.php file. I edited the file in Microsoft’s Expression Web and it added those weird characters. I fixed it by using “edit” from a DOS prompt. I was able to eliminate those hidden characters and save the file. That allowed the script to work and obviously Wordpress is working now.

I spent about an hour yesterday looking for a way to force Expression Web to NOT use BOM, but no luck. I found a few tutorials that showed how to eliminate it by changing the UTF, but that could come back to bite you as well, as that’s where the language encoding is stored. I guess the short answer is don’t edit PHP files in Expression Web.

Here’s a Wiki article on BOM:
http://en.wikipedia.org/wiki/Byte_Order_Mark

Here’s one on UTF-8:
http://en.wikipedia.org/wiki/UTF-8

And finally, here’s the Wiki article on WTF?!:
http://en.wikipedia.org/wiki/WTF

Hidden characters in Expression Web files

Monday, October 15th, 2007

I tried a few times to install wordpress on my domain - elgincomputerguy.com. I kept getting weird errors. I’d clear the database and start again, but the same thing kept happening.

I finally went to the support forums and found other people having the same problem and one of the suggested answers said that the file must start with “<?php” - any blank lines or spaces will mess it up. That’s when I remembered that I’d edited the file with Microsoft Expression Web and it adds some kind of weird characters at the beginning of every file.

I just found out about that weirdness within Expression Web a couple of months ago. Here’s what the file looked like in notepad:

NotepadHere's how it looks in Notepad

and here’s how it looks when I go to the DOS prompt and use “edit”:

EDIT

Isn’t that weird? I love Expression Web - I switched from Dreamweaver several months ago, but this odd behavior makes me have second thoughts. This is the second time it bit me - both times while I was doing PHP. You’d think I would have caught it sooner!

Notice that Notepad doesn’t display the hidden characters. If you create the file in Notepad, they’re not there, but if you do it in Expression Web then open in Notepad, they won’t show, but if you modify the file in Notepad and save it - the hidden characters remain. The only way I know of to get rid of them once they’re in a file is to use the DOS prompt and EDIT.