Unknown characters encountered when saving File.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
faisy_master
Forum Newbie
Posts: 10
Joined: Sun Aug 21, 2005 1:29 am

Unknown characters encountered when saving File.

Post by faisy_master »

Hello,

I have this strange problem when writing the data (a paragraph) in the file.

It is all fine till when I save it.

When I open it to view, it has following characters changed into some alienated characters.
  • " (Apostropge)
  • ' (Single Apostrophe)
  • - (Dash or Hyphen)
Now these characters in all the paragraph change into some stupid unreadable characters.

Any help please ! :oops:
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Unknown characters encountered when saving File.

Post by kaszu »

I guess these symbols in paragraph are not " ' and -, but ones from here http://htmlhelp.com/reference/html40/en ... ecial.html.
Webpage has an encoding (like utf-8), but when this paragraph is saved into a file, this file doesn't have an encoding specified, that's why they look wierd.
If you open the file with some editor, which supports encoding changing (not sure how it's called) and you will have a look at that file in encoding utf8 (or whatever it was on your website), then they will look ok.

Anyway if you will output this file to the page with the same encoding, which was in the beginning, then they will look normal.
Post Reply