0

I have a graffiti blog and i have a strange problem which is showing strange char page like this:

alt text http://amrelgarhy.com/ScreenShots/error.jpg

This page was showing when I opened my control panel admin page. It's also showing the same when I try to edit one of my previous posts. My problem is that i don't know what's the reason behind it.

I am not sure how to fix this. All my posts are in English and I always use Windows Live Writer to post.

Has anyone faced a problem like this before? Can you advise me on finding the cause of this problem, and any potential solution?

p.campbell
  • 98,673
  • 67
  • 256
  • 322
Amr Elgarhy
  • 66,568
  • 69
  • 184
  • 301
  • Should probably be asked here: http://webapps.stackexchange.com/ – Igor Zevaka Jul 14 '10 at 23:00
  • may be, i am not sure, i asked here because it may have something to do in the graffiticms code files, but it's ok, if more people think the same i will delete from here and ask there. – Amr Elgarhy Jul 14 '10 at 23:03
  • 3
    That looks like some image data interpreted as text data. Do your pages contain images, and is it possible that these are somehow inlined? Does this also occur on pages that do not contain any images? – Residuum Jul 24 '10 at 01:17
  • It's definitely a binary file. What's the file name and extension? – BalusC Jul 24 '10 at 03:37

3 Answers3

1

Looks like it might be an encoding mismatch. Are you opening UTF-8 (or some other Unicode)-encoded files in a tool that doesn't understand UTF encodings or vice-versa?

DaveE
  • 3,579
  • 28
  • 31
  • Open the file in an editor that understands various encodings. NotePad++ is one (notepad-plus-plus.org). Even Windows' Notepad can tell you if a file is Unicode or not. If you need to use an ASCII-only editor and you see '' as the first three bytes, you've got a UTF-8 file. 'þÿ' or 'ÿþ' indicate a flavor of UTF-16. – DaveE Jul 15 '10 at 00:03
  • When i saved the page as a file i got this at the first line of the file:��������`I�%& – Amr Elgarhy Jul 15 '10 at 00:13
  • do you have access to the source? It might be if this is being saved to a database that the input isn't being converted into a compatible encoding. My company is currently going through a conversion of our SQL Server database from storing text in CP1252 to UTF-16. It's not pretty-we've had some odd data conversion errors. – DaveE Jul 15 '10 at 03:48
  • Yes i have access, so should i open the database and go through the records and check if something didn't save well? – Amr Elgarhy Jul 15 '10 at 10:58
  • Yep. Is the font you're using Unicode-capable? If there are code points in the data that your font can't display, you'll see garbage characters. If you're looking at the data directly, check to see if you have binary zeroes interspersed in the string - that's a quick-and-dirty indication that you may have unicode characters (UTF-16). Typically, though, a string value won't have the Byte Order Marks at the start, only files. – DaveE Jul 15 '10 at 16:18
0

Try placing this in your master page:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Also, check that a virtual directory has been created.

IrishChieftain
  • 15,108
  • 7
  • 50
  • 91
0

There seems to be a problem with the content MIME-types. The weirdness you are seeing happens because the server offers content as binary (I'm guessing application/octet-stream) even though it should offer them as text/html. Images should be offered as image/<extension>, for example image/png.

You can manually set MIME-type handlers to certain filetypes. If you are using Apache, you could easily to this in a .htaccess file like this:

AddType text/html .html

If your content is something else than HTML the MIME-type is something different. If your web-server doesn't automatically do this you should probably add the handlers yourself.

All MIME-types can be found from here: http://www.iana.org/assignments/media-types/

thevilledev
  • 2,367
  • 1
  • 15
  • 19