You are here: Re: UTF-8 file reading and writing for PHP « PHP Programming Language « IT news, forums, messages
Re: UTF-8 file reading and writing for PHP

Posted by HaggMan on 12/18/41 11:49

Thank you, both of you, for your help... I finally figured out what
does it:

The part I didn't mention (go figure, I thought it was harmless) is
that I was doing some str_replaces (with regex) on the UTF8 stuff, and
that is what messed up the output. So, when I accept the normal input,
save it to the file, and throw out the normal output, it comes out
exactly as I typed it (I'm testing with Arabic).

So I guess a followup question would be: How do I parse through UTF8
stuff with regexpressions? I'll do some research tomorrow.

Thank you again!

HaggMan


R. Rajesh Jeba Anbiah wrote:
> HaggMan wrote:
> > I'm creating a page that:
> > - accepts user input in whatever language
> > - saves that input to a file
> > - reads the file and displays the original input
> >
> > The following code successfully writes the user input to a file (when I
> > open the file, it's in the correct font), but I can't get PHP to read
> > the file and display the correct characters.
> <snip>
>
> Save your (processing) PHP script in UTF-8.
>
> --
> <?php echo 'Just another PHP saint'; ?>
> Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация