By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,350 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,350 IT Pros & Developers. It's quick & easy.

character

P: n/a
The character shows up multiple times on my parsed strings. I tried to get
rid of it with the following code without success. Is that character
represented by anything else? Thanks

$bad_chars = array(chr(194), '');
str_replace($bad_chars, '', $parsed_string)
May 13 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On May 13, 6:58 am, "Peter Parker" <spider...@home.comwrote:
The character shows up multiple times on my parsed strings. I tried to get
rid of it with the following code without success. Is that character
represented by anything else? Thanks

$bad_chars = array(chr(194), '');
str_replace($bad_chars, '', $parsed_string)
sounds like an encoding issue, you need to make sure of the encoding
of the string you are parsing, try converting it to something you are
sure that the parser will understand, like iso-8859-1 from utf-8 for
instance.
consider using mb_ functions which understand multibyte characters,
php has not got good support for character encoding, alot of its
functions are not utf8 aware, but some have options to allow that
awareness, if you are using php5 you are better off than struggling
with php4, but roll on 6.

May 13 '07 #2

P: n/a
At Sun, 13 May 2007 05:30:51 -0700, shimmyshack let his monkeys type:
On May 13, 6:58 am, "Peter Parker" <spider...@home.comwrote:
>The character shows up multiple times on my parsed strings. I tried to get
rid of it with the following code without success. Is that character
represented by anything else? Thanks

$bad_chars = array(chr(194), '');
str_replace($bad_chars, '', $parsed_string)

sounds like an encoding issue, you need to make sure of the encoding
of the string you are parsing, try converting it to something you are
sure that the parser will understand, like iso-8859-1 from utf-8 for
instance.
consider using mb_ functions which understand multibyte characters,
php has not got good support for character encoding, alot of its
functions are not utf8 aware, but some have options to allow that
awareness, if you are using php5 you are better off than struggling
with php4, but roll on 6.
O.T., Shimmyshack is it my newsreader not capable of handling the type of
subject string you send, or is it something misconfigured in your system
or at the google groups end ?? All your posts appear in my header pane
formatted roughly like:

=?iso-8859-1?q?Re:_character_=C2?=

I am using pan 0.14.2 btw, on Gentoo Linux, kernel 2.6.17-gentoo-r7

Rgds
Sh.

May 13 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.