Foreign Characters in PHP

This is a discussion on Foreign Characters in PHP within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I'm currently working on a website that can convert words from English to French and vice versa. My problem ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-27-2007
Matt White
 
Posts: n/a
Default Foreign Characters in PHP

I'm currently working on a website that can convert words from English to
French and vice versa. My problem is this: every time I try to output a
character like é, it comes out as either a box (in IE) or as a question-mark
in a diamond (in FF). To get around this, I use the function:
str_replace("é", "é", $french);. This grabs all accented characters
and converts them into HTML characters. While I can do this, is there
anyway to make sure these characters stay the same and do not need to be
replaced?

Matt

Reply With Quote
  #2 (permalink)  
Old 03-27-2007
www.j2be.com
 
Posts: n/a
Default Re: Foreign Characters in PHP


"Matt White" <mgw854@msn.com> ha scritto nel messaggio
news:Vy6Oh.4249$xE.2229@trnddc08...
> I'm currently working on a website that can convert words from English to
> French and vice versa. My problem is this: every time I try to output a
> character like é, it comes out as either a box (in IE) or as a
> question-mark in a diamond (in FF). To get around this, I use the
> function: str_replace("é", "&eacute;", $french);. This grabs all accented
> characters and converts them into HTML characters. While I can do this,
> is there anyway to make sure these characters stay the same and do not
> need to be replaced?
>
> Matt


to convert the characters in html entities
http://www.php.net/htmlentities

to decode te entities back to the characters
http://www.php.net/html_entity_decode

Regards


Reply With Quote
  #3 (permalink)  
Old 03-27-2007
Gleep
 
Posts: n/a
Default Re: Foreign Characters in PHP

On Tue, 27 Mar 2007 10:43:01 GMT, "Matt White" <mgw854@msn.com> wrote:

>I'm currently working on a website that can convert words from English to
>French and vice versa. My problem is this: every time I try to output a
>character like é, it comes out as either a box (in IE) or as a question-mark
>in a diamond (in FF). To get around this, I use the function:
>str_replace("é", "&eacute;", $french);. This grabs all accented characters
>and converts them into HTML characters. While I can do this, is there
>anyway to make sure these characters stay the same and do not need to be
>replaced?
>
>Matt



try resetting the browser characters set
http://www.columbia.edu/kermit/csettables.html
latin 4


Reply With Quote
  #4 (permalink)  
Old 03-31-2007
Matt White
 
Posts: n/a
Default Re: Foreign Characters in PHP

Thanks for the help, it now seems to be working!

"Gleep" <Gleep@Gleep.com> wrote in message
news:17qi03hbh95llhdcqhh9vvu1n8a0fjck5d@4ax.com...
> On Tue, 27 Mar 2007 10:43:01 GMT, "Matt White" <mgw854@msn.com> wrote:
>
>>I'm currently working on a website that can convert words from English to
>>French and vice versa. My problem is this: every time I try to output a
>>character like é, it comes out as either a box (in IE) or as a
>>question-mark
>>in a diamond (in FF). To get around this, I use the function:
>>str_replace("é", "&eacute;", $french);. This grabs all accented
>>characters
>>and converts them into HTML characters. While I can do this, is there
>>anyway to make sure these characters stay the same and do not need to be
>>replaced?
>>
>>Matt

>
>
> try resetting the browser characters set
> http://www.columbia.edu/kermit/csettables.html
> latin 4
>
>

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:19 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0