0

I am having some trouble with some corrupted characters appearing on my form. I currently have my code in notepad++. What is seen in the following image is what happens when my code is encoded as UTF8 without BOM. https://i.stack.imgur.com/GGXyD.png

http://puu.sh/7pBGQ.png The second image is what happens when it is saved as UTF8. However, then I get the follow problems.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/.../event.php:1) in /home/.../validation.php on line 6

event.php starts off like:

<?php
require 'validation.php';
require 'member_header.php';
require 'member_header_vevent.php';
?>

<HTML>

<HEAD>

<!-- UTF-8 is the recommended encoding for your pages -->

<meta http-equiv="content-type" content="text/xml; charset=utf-8" />

<TITLE>Special Event</TITLE>

<LINK rel='shortcut icon' href='images/vyico.ico'>

validation.php starts off like:

<?php
$page_title = "validation";

// some comments

session_start();

My understanding is that my files probably should be saved as UTF8, however something about that is causing the warning to pop up. From what I was looking around, that warning comes around if something appears the

  • Check the HTTP response headers. You'll probably see the site is sending ISO-8859-1 instead of UTF-8. – Mike Mar 10 '14 at 01:21
  • You want to save it as UTF-8, without the byte-order-mark (BOM). Are there any HTTP headers being sent with the content that specify the character encoding, or are you only declaring the character encoding at the document level? – Jeff Lambert Mar 10 '14 at 01:22
  • Also check validation.php for white space at the beginning. – Mike Mar 10 '14 at 01:26
  • @watcher I have tried saving as UTF8 w/o BOM, I still get those  characters to appear. From what I understand,  is the Hex for EF BB BF. When I save w/o BOM, these hex characters do not appear in event.php's file at the beginning but appear on the site. Maybe I'm using the wrong ftp transfer type? My ftp program is set on Auto. – user2859406 Mar 10 '14 at 01:33
  • I wouldn't suspect it to be the ftp (although it's possible). Use Chrome dev tools or Firebug to look at the headers on the response coming back, especially the `Content-Type` header – Jeff Lambert Mar 10 '14 at 01:39

1 Answers1

1

Byte order mark striking again. This is a common question please refer to these answers and try to use it in all your files:

  1. https://stackoverflow.com/a/3256014/3399968
  2. https://stackoverflow.com/a/1068700/3399968
  3. https://stackoverflow.com/a/3256183/3399968
Community
  • 1
  • 1
carlitos
  • 26
  • 2
  • After reading your last few words, "in all your files", I just gave myself a huge facepalm. I missed one of the files, I had originally tried UTF8 w/o BOM in my files, however I missed a single one that was linked and it resulted in the corrupted character. So I thought my problem was bigger than I thought. – user2859406 Mar 10 '14 at 01:41