Re: Magic Quotes or Curley Quotes or Something

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marco,

Thanks for the help, you gave me a place to start. Before doing what would
amount to a lot of coding to correct this problem throughout my site I
wanted to see if it could be corrected on the server side.

I found the following section in the php.ini file:

; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header.  To disable sending of the charset, simply
; set it to be empty.
;
; PHP's built-in default is text/html
default_mimetype = "text/html"
default_charset = "utf-8"
;default_charset = "iso-8859-1"

In the default file the iso-8859-1 line was commented out so I uncommented
it to see it that would help. It changed the unreadable goop to another
type of unreadable goop but the problem remained.

I then recommented the iso-8859-1 line and added the utf-8 line. This
changed the output back to what I had before. My thinking is that since my
code worked under the older version of php, it should also work under the
newer version if I can configure it correctly.

Thanks,

Lance

> Hello Lance--
>
> On 8/5/05 2:18 PM, "Lance Earl" <lance@xxxxxxxxxxxxx> wrote:
>
>> I recently upgraded my server. It is running Ubuntu Linux with PHP and
>> MySQL. My site allows people to post content to their own web oages
>> through a web interface. Many of my customers compose their content on a
>> word processer and then cust and paste it to the web interface for
>> insertion to the database and later retrevial and display on a web page.
>>
>> The problem I am having is that content which includes quotes is is not
>> being seen correctly. Rather than inserting a slashed quote (/"), it
>> inserts a bunch of strange formatted gunk. A sample of the problem anc
>> be
>> seen at www.dallypost.com/ranch/page5688.php
>>
>
> You have an encoding problem--the content is being uploaded to your site
> using a different encoding mechanism (most likely utf-8) than the one you
> use to display it.
>
> I'm not much of an expert in this area, but a couple of suggestions:
>
> 1. You're already outputting UTF-8 code from the looks of it, so a simple
>
> Header ("Content-type: text/html; charset=utf-8");
>
> Or even adding this to your HTML code in the <HEAD>:
>
> <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">
>
> Should do it. Remember to also use htmlentities ($data, null, "utf-8"); to
> properly encode the entities in your content.
>
> 2. Convert the text over from UTF-8 to ISO-8859-1. I think you can use
> utf8_decode, or you may have to go with the mbstring extension (not too
> sure
> here, I'd just go ahead and convert everything over to UTF-8).
>
> I'm sure some other people who have more experience with this stuff can
> give
> you even more pointers, but this should get you started.
>
> Cheers,
>
>
> Marco
>
> --
> BeebleX - The PHP Search Engine
> http://beeblex.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Lance Earl, President
DallyPost, Inc. - Equine Marketing/Training/Shows
Rockland, Idaho     208-548-2721 or 208-604-2721
lance@xxxxxxxxxxxxx
http://www.dallypost.com      http://www.dallypost.com/ranch
Horse Marketing - Clinics - Shows

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux