Friday, January 30, 2009

Re: utf-8 encoding problem

How did you save your files? Are you working on Windows (using
character set windows-1256) ?

Windoze by default saves files on the file system with the default
ANSI character set. In order to get it to save as UTF-8, you have to
explicitly tell it to (e.g. in Notepad change the dropdown for
encoding from ANSI to UTF-8).

On Jan 29, 11:48 pm, mohammad al-ani <alani.moham...@gmail.com> wrote:
> and when i choose the windows-1256 i see the real world which is مقال
>
> On Fri, Jan 30, 2009 at 10:23 AM, mohammad al-ani
> <alani.moham...@gmail.com>wrote:
>
> > params show me the value of the key 'keyword' is yes like this symbols
>
> > On Fri, Jan 30, 2009 at 2:48 AM, brian <bally.z...@gmail.com> wrote:
>
> >> What does $this->params show you?
>
> >> On Thu, Jan 29, 2009 at 5:18 PM, medo <alani.moham...@gmail.com> wrote:
>
> >> > hi group,
>
> >> > i have problem with my search feature in my site the problem is when i
> >> > use the search page to search for an Arabic word with the form get
> >> > method. and i faced that problem in the prototype below
>
> >> >>>>>>>>>> search_controller.php  <<<<<<<<<<
>
> >> > <?php
>
> >> > class SearchController extends AppController {
> >> >  var $name='Search';
> >> >  var $uses=array('Article');
>
> >> >  function index(){
> >> >    $this->layout='page';
> >> >    if (isset($_GET['keyword'])) {
> >> >      $this->set('articles',$this->Article->find('all',array
> >> > ('conditions'=>array('Article.body like'=>'%'.base64_decode($_GET
> >> > ['keyword']).'%'))));
> >> >      $this->set('keyword',$_GET['keyword']);
> >> >      $this->data['Search']['keyword']=urlencode(base64_decode($_GET
> >> > ['keyword']));
> >> >    }
> >> >  }
> >> > }
>
> >> > ?>
>
> >> >>>>>>>>>> index.ctp  <<<<<<<<<<
>
> >> > <?php e($form->create(null,array('type'=>'get','url'=>'/search'))); ?>
> >> > <?php e($form->input('Search.keyword',array('label'=>'الكلمة المراد
> >> > البحث عنها'))); ?>
> >> > <?php e($form->end('ابحث'));?>
> >> > <hr />
> >> > نتائج البحث عن <?php e($keyword); ?>
>
> >> > <?php var_dump($articles); ?>
>
> >> > and i use utf-8 for the layout.
>
> >> > the problem is that the result of echoing $keyword is '' why that and
> >> > how to solve that
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: