Re: UTF-8 in PHP?

2008-02-29 Thread Dotan Cohen
Alright, I solved the problem. Here is the code for converting final letters in the middle of a word to normal letters, if anyone ever needs it: $text=עברית מבולגנת; function hebrewNotWordEndSwitch ($from, $to, $text) { $text=preg_replace('/'.$from.'([א-ת])/u','$2'.$to.'$1',$text);

UTF-8 in PHP?

2008-02-28 Thread Dotan Cohen
I'm trying to make a regex that will change kaf, mem, nun, pe, and tzadik to their final form if they are at the end of a word. On the php mailing list, we came to this regex, which works to replace a letter only at the end of a word, and it works well: $text=preg_replace('/\b([^\s]+)a\b.*/U',

Re: UTF-8 in PHP?

2008-02-28 Thread shimi
On 2/28/08, Dotan Cohen [EMAIL PROTECTED] wrote: I'm trying to make a regex that will change kaf, mem, nun, pe, and tzadik to their final form if they are at the end of a word. On the php mailing list, we came to this regex, which works to replace a letter only at the end of a word, and it

Re: UTF-8 in PHP?

2008-02-28 Thread Dotan Cohen
On 28/02/2008, shimi [EMAIL PROTECTED] wrote: It can be a UTF-8 problem in general - PHP has many functions that are not UTF-8 aware, which is why we have the mbstring functions... which are equivalent to historical PHP functions, but work well on multibyte strings... there's even an option to

Re: UTF-8 in PHP?

2008-02-28 Thread Meir Kriheli
Dotan Cohen wrote: On 28/02/2008, shimi [EMAIL PROTECTED] wrote: It can be a UTF-8 problem in general - PHP has many functions that are not UTF-8 aware, which is why we have the mbstring functions... which are equivalent to historical PHP functions, but work well on multibyte strings... there's

Re: UTF-8 in PHP?

2008-02-28 Thread Dan Kenigsberg
On Thu, Feb 28, 2008 at 12:34:42PM +0200, Dotan Cohen wrote: I'm trying to make a regex that will change kaf, mem, nun, pe, and tzadik to their final form if they are at the end of a word. On the php mailing list, we came to this regex, which works to replace a letter only at the end of a