Re: Encoding problem

2009-09-16 Thread Roman

finally I found the solution to my problem. It was not the  issue with
DB either CakePHP. Problem was in PHP - low function. Never use it if
you use encoding different than iso-8859-1. Instead of low use
mb_strtolower(string, 'UTF-8).

Thanks for help.

On 15 Wrz, 14:16, brian bally.z...@gmail.com wrote:
 Also, use a terminal to verify that the data is as it should be. If
 all you have to work with is PHPMyAdmin, check that its pages are
 using UTF-8.

 It's easy, with MySQL, to import UTF-8 data that gets destroyed. If
 using an import file, put the following at the top:

 SET NAMES 'utf8';

 And, of course, make sure that database.php has 'encoding' = 'utf8'
 and that your layout has the proper character set meta tag.

 On Tue, Sep 15, 2009 at 2:06 AM, Sergei yatse...@gmail.com wrote:

  What DB do you use? It is not CakePHP, it 's DBMS problem.

  If MySql, set encoding to UTF8 and DB collation to utf8_unicode_ci,
  not utf8_general_ci.

  On Sep 15, 5:11 am,Romanroman.janowc...@gmail.com wrote:
  Hi,
  I have created filter using paginate with extra options taken from
  input fields. Service and database use UTF-8 (checked). When I try to
  filter word with polish characters (e.g. ósma) cakephp does not return
  proper value.
  Do you have any idea ?
  Regards,
 Roman
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Encoding problem

2009-09-16 Thread Martin Westin

Thanks for finding that one. I had not caught that before and I use
non-english characters all the time. Guess Iäd better slow my
application down by replacing all strtolower with the mb_ version...
and possibly if clauses and things to make sure mb is installed.

But have a look at php.net... it is possibly quicker to ask mysql to
convert to lowercase than php (oh dear). It sounds incredible and I
haven't run a test of this myself.
http://se2.php.net/manual/en/function.mb-strtolower.php


Quick rant:
It makes my blood boil every time PHP makes my jaw to drop to the
floor like this. Come on! Shouldn't this kind of thing be handled by
PHP internally? mb this and mb that. Utf8 is 8bit, single byte, is it
not? I don't have a single setting in my installation of php that
suggests I prefer 8859. Take a hint why don't you, you silly language!

BTW, why is this in the comments on php.net:
mb_strtolower($str, mb_detect_encoding($str));
Why is that not built into the function? If PHP can detect the
encoding... don't give me the option to screw it up but entering the
wrong one! I can not come up with a single situation where I would
want to make a string lowercase but do it badly and treat some
characters the wrong way. Artistic reasons? I would have liked to see
strtolower() do just that. They could have added a
artistic_encoding_reinterpretation_strtolower() so that the 99.999% of
calls to the function did what that name suggested.

end rant.

thanks again for posting this... I have some work to do :)


On Sep 16, 8:04 am, Roman roman.janowc...@gmail.com wrote:
 finally I found the solution to my problem. It was not the  issue with
 DB either CakePHP. Problem was in PHP - low function. Never use it if
 you use encoding different than iso-8859-1. Instead of low use
 mb_strtolower(string, 'UTF-8).

 Thanks for help.

 On 15 Wrz, 14:16, brian bally.z...@gmail.com wrote:



  Also, use a terminal to verify that the data is as it should be. If
  all you have to work with is PHPMyAdmin, check that its pages are
  using UTF-8.

  It's easy, with MySQL, to import UTF-8 data that gets destroyed. If
  using an import file, put the following at the top:

  SET NAMES 'utf8';

  And, of course, make sure that database.php has 'encoding' = 'utf8'
  and that your layout has the proper character set meta tag.

  On Tue, Sep 15, 2009 at 2:06 AM, Sergei yatse...@gmail.com wrote:

   What DB do you use? It is not CakePHP, it 's DBMS problem.

   If MySql, set encoding to UTF8 and DB collation to utf8_unicode_ci,
   not utf8_general_ci.

   On Sep 15, 5:11 am,Romanroman.janowc...@gmail.com wrote:
   Hi,
   I have created filter using paginate with extra options taken from
   input fields. Service and database use UTF-8 (checked). When I try to
   filter word with polish characters (e.g. ósma) cakephp does not return
   proper value.
   Do you have any idea ?
   Regards,
  Roman
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Encoding problem

2009-09-16 Thread Martin Westin

I noted that you need to do some extra work on ucfirst() since it has
no direct mb_ equivalent. You have to roll your own or pick one from
php.net since mb_convert_case() can only work like ucwords().



On Sep 16, 11:42 am, Martin Westin martin.westin...@gmail.com wrote:
 Thanks for finding that one. I had not caught that before and I use
 non-english characters all the time. Guess Iäd better slow my
 application down by replacing all strtolower with the mb_ version...
 and possibly if clauses and things to make sure mb is installed.

 But have a look at php.net... it is possibly quicker to ask mysql to
 convert to lowercase than php (oh dear). It sounds incredible and I
 haven't run a test of this 
 myself.http://se2.php.net/manual/en/function.mb-strtolower.php

 Quick rant:
 It makes my blood boil every time PHP makes my jaw to drop to the
 floor like this. Come on! Shouldn't this kind of thing be handled by
 PHP internally? mb this and mb that. Utf8 is 8bit, single byte, is it
 not? I don't have a single setting in my installation of php that
 suggests I prefer 8859. Take a hint why don't you, you silly language!

 BTW, why is this in the comments on php.net:
 mb_strtolower($str, mb_detect_encoding($str));
 Why is that not built into the function? If PHP can detect the
 encoding... don't give me the option to screw it up but entering the
 wrong one! I can not come up with a single situation where I would
 want to make a string lowercase but do it badly and treat some
 characters the wrong way. Artistic reasons? I would have liked to see
 strtolower() do just that. They could have added a
 artistic_encoding_reinterpretation_strtolower() so that the 99.999% of
 calls to the function did what that name suggested.

 end rant.

 thanks again for posting this... I have some work to do :)

 On Sep 16, 8:04 am, Roman roman.janowc...@gmail.com wrote:



  finally I found the solution to my problem. It was not the  issue with
  DB either CakePHP. Problem was in PHP - low function. Never use it if
  you use encoding different than iso-8859-1. Instead of low use
  mb_strtolower(string, 'UTF-8).

  Thanks for help.

  On 15 Wrz, 14:16, brian bally.z...@gmail.com wrote:

   Also, use a terminal to verify that the data is as it should be. If
   all you have to work with is PHPMyAdmin, check that its pages are
   using UTF-8.

   It's easy, with MySQL, to import UTF-8 data that gets destroyed. If
   using an import file, put the following at the top:

   SET NAMES 'utf8';

   And, of course, make sure that database.php has 'encoding' = 'utf8'
   and that your layout has the proper character set meta tag.

   On Tue, Sep 15, 2009 at 2:06 AM, Sergei yatse...@gmail.com wrote:

What DB do you use? It is not CakePHP, it 's DBMS problem.

If MySql, set encoding to UTF8 and DB collation to utf8_unicode_ci,
not utf8_general_ci.

On Sep 15, 5:11 am,Romanroman.janowc...@gmail.com wrote:
Hi,
I have created filter using paginate with extra options taken from
input fields. Service and database use UTF-8 (checked). When I try to
filter word with polish characters (e.g. ósma) cakephp does not return
proper value.
Do you have any idea ?
Regards,
   Roman
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Encoding problem

2009-09-15 Thread Sergei

What DB do you use? It is not CakePHP, it 's DBMS problem.

If MySql, set encoding to UTF8 and DB collation to utf8_unicode_ci,
not utf8_general_ci.



On Sep 15, 5:11 am, Roman roman.janowc...@gmail.com wrote:
 Hi,
 I have created filter using paginate with extra options taken from
 input fields. Service and database use UTF-8 (checked). When I try to
 filter word with polish characters (e.g. ósma) cakephp does not return
 proper value.
 Do you have any idea ?
 Regards,
 Roman
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Encoding problem

2009-09-15 Thread brian

Also, use a terminal to verify that the data is as it should be. If
all you have to work with is PHPMyAdmin, check that its pages are
using UTF-8.

It's easy, with MySQL, to import UTF-8 data that gets destroyed. If
using an import file, put the following at the top:

SET NAMES 'utf8';

And, of course, make sure that database.php has 'encoding' = 'utf8'
and that your layout has the proper character set meta tag.

On Tue, Sep 15, 2009 at 2:06 AM, Sergei yatse...@gmail.com wrote:

 What DB do you use? It is not CakePHP, it 's DBMS problem.

 If MySql, set encoding to UTF8 and DB collation to utf8_unicode_ci,
 not utf8_general_ci.



 On Sep 15, 5:11 am, Roman roman.janowc...@gmail.com wrote:
 Hi,
 I have created filter using paginate with extra options taken from
 input fields. Service and database use UTF-8 (checked). When I try to
 filter word with polish characters (e.g. ósma) cakephp does not return
 proper value.
 Do you have any idea ?
 Regards,
 Roman
 


--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Encoding problem

2009-09-14 Thread Roman

Hi,
I have created filter using paginate with extra options taken from
input fields. Service and database use UTF-8 (checked). When I try to
filter word with polish characters (e.g. ósma) cakephp does not return
proper value.
Do you have any idea ?
Regards,
Roman
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-02-04 Thread Martin Westin


I wouldn't call it normal. I am not sure there is a normal collation.
If you state nothing else MySQL will choose utf8_general_ci so that
would be the default.

Binary collation is the collation for non-lingual text. Every
character counts and order clauses cause them to be ordered by their
code-number, not any alphabet.

Every other collation attempts to follow the rules of particular
languages. They each have a cs and ci version for case (in)
sensitivity.

The general and unicode collations are quite similar in behavior
(can't remember the differences) and roughly equate to the rules of
the English language. If you only store basic English characters you
are luck and can stop worrying now.

But storing Swedish names in such a field will make poopie out of
string comparisons and ordering of results. Ä be an A with some
insignificant dots, even though it is a separate character in the
Swedish language. The same goes for Spanish and any other language
with anything but the 26 characters a-z.

So, to cope with Swedish there is a utf8_swedish_ci (or cs) which
recognizes Ä as it's own character but é as just an e and so on.

I had a word of trouble with collations on a project last year. I was
taken by surprise when MySQL decides to see A and Ä as the same
character in where clauses... I thought collation was for ordering
only, but it affects where statements, indexes and other things as-
well.

I strongly recommend reading the confusing and boring pages in the
MySQL manual on the subject if you store and search for data in any
language other than English.

/Martin


On Feb 4, 1:37 am, Webweave webwe...@gmail.com wrote:
 The ci flavors are for case-insensitive versions, so if you want
 John to be equal to john with no case conversion, you use one of
 them.

 The utf8_bin is the normal collation.

 On Feb 3, 10:28 am, BrendonKoz brendon...@hotmail.com wrote:

  While on this subject, which MySQL table encoding is the normal,
  default utf-8 encoding?  utf8_bin, or utf8_general_ci, or
  utf8_unicode_ci?

  On Feb 3, 8:48 am, Marcelo Andrade mfandr...@gmail.com wrote:

   On Tue, Feb 3, 2009 at 8:55 AM, mohammad al-ani

   alani.moham...@gmail.com wrote:
Dr. Loboto all of my pages encoded with utf-8 and the problem is not in 
my
page the problem is with the firefox and everything go perfect with IE

   It works on IE because the CP-1252 encoding is a Windows-specific encoding
   that works primarily on the Microsoft products.  Unless you intend to 
   make your
   pages working only on IE, don't use it.

   To solve your problem, open all of your files in a smart text editor and 
   resave
   all of them with the UTF-8 (without BOM) encoding.  Check your editor 
   about
   doing this.

   Best regards.

   --
   MARCELO DE F. ANDRADE (aka eleKtron)
   Belem, PA, Amazonia, Brazil
   Linux User #221105

   [...@pará ~]# linkshttp://pa.slackwarebrasil.org/

   For Libby's backstory be told on 
   Losthttp://www.petitiononline.com/libby423/petition.html
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-02-03 Thread mohammad al-ani
Dr. Loboto all of my pages encoded with utf-8 and the problem is not in my
page the problem is with the firefox and everything go perfect with IE

see my last reply to Webweave

On Tue, Feb 3, 2009 at 6:50 AM, Dr. Loboto drlob...@gmail.com wrote:


 Mohammad Al-Ani, you really found your real problem - your page is not
 UTF-8 page! %xx form is url-encoded non-ANSI string as only 7-bit
 symbols can be used in URLs. That's why browers encode non-ANSI
 symbols and then they are automatically decoded by Cake before go into
 params. Some of browsers show encoded string in address bar and you
 see %xx string, some - not encoded and you see real word. Word %E3%DE
 %C7%E1 you saw in Firefox is wrong word, possibly encoded using
 windows-1256 as you indicated above. But Cake expects UTF-8, and real
 word in url-encoded form should looks like %D9%85%D9%82%D8%A7%D9%84

 Correct all your pages encodings to UTF-8 and problem will go away!

 On Feb 3, 1:21 am, mohammad al-ani alani.moham...@gmail.com wrote:
  thank you Dr. Loboto but i find the real problem.
 
  i develop the site under firefox so if i use the internet explorer i can
 get
  the arabic word like it it but when i use the firefox and search for word
  like مقال the address of firefox will be
 
  /search?keyword=مقال
 
  and when i just confirm this link by press enter on it the firefox
 converted
  the link to
 
  http://www.localhost.com/alsameriae/search?keyword=%E3%DE%C7%E1
 
  which will cuase the problem so is there any way to check form the
 encoding
  type
 
  On Mon, Feb 2, 2009 at 6:38 AM, Dr. Loboto drlob...@gmail.com wrote:
 
   Your problem is caused by wrong page encoding. Follow Marcelo Andrade
   checklist to eliminate wrong encoding on all steps. Everywhere should
   be UTF-8 and URL will be in UTF-8 too. Or you use some unknown really
   stupid browser that can't handle UTF-8 at all - but I can't imagine
   such a browser in present time.
 
   On Feb 1, 3:02 pm, mohammad al-ani alani.moham...@gmail.com wrote:
thank you all for your time and help
 
but my problem actually is caused by the browser . he send the url
 query
   to
the cakephp in the form of ANSI and i configure the cake and the
 header
   of
generated page to use the utf-8 so the quastion is how to change the
   recived
ansi data to the utf-8 data it's not about notpad++ it's about
 dynamic
   read
write data
 
On Fri, Jan 30, 2009 at 6:54 PM, Marcelo Andrade 
 mfandr...@gmail.com
   wrote:
 
 On Thu, Jan 29, 2009 at 7:18 PM, medo alani.moham...@gmail.com
   wrote:
  (..)
 
 This is a very common issue.  Just follow this checklist:
 
 1. Using a smart editor (for Windows: Notepad++, Textpad, ...; for
 Gnu/Linux: Gedit,
 Kedit, Geany, Kate, Vim...), be sure that all of your .php and .ctp
 files are saved
 with the UTF-8 (without BOM) encoding;
 
 2. Be sure that your webserver is configured to serve the pages in
 UTF-8 encoding
 (in Apache, the line 'AddDefaultCharset UTF-8' in your httpd.conf);
 
 3. Be sure that your database tables are configured with the UTF-8
   encoding
 (in
 MySql, create your tables with the proper collation option);
 
 4. In the very last case, if the problem still persists and your
 are a
 really paranoid,
 change the PHP interpreter encoding in your php.ini.
 
 Best regards.
 
 --
 MARCELO DE F. ANDRADE (aka eleKtron)
 Belem, PA, Amazonia, Brazil
 Linux User #221105
 
 [...@pará ~]# linkshttp://pa.slackwarebrasil.org/
 
 For Libby's backstory be told on Lost
http://www.petitiononline.com/libby423/petition.html
 


--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-02-03 Thread Webweave

Must be something wrong with your copy of Firefox: I don't get any mis-
encoding of the URL in mine.

I have version 3.0.5 and tested it both on Windows XP and Mac OS X
with no problems.

The URL that gets displayed in the browser by pressing enter in the
address bar is the one with the Arabic characters in it that I posted
before.

The URL that I see if I click the Google search button after that does
get encoded, but it properly encodes as 
http://www.google.com/search?hl=enrls=igq=مقالbtnG=Search

Now when I paste the URL into the Google groups editor, I do get
http://www.google.com/search?hl=enrls=igq=%D9%85%D9%82%D8%A7%D9%84btnG=Search,
but even that does the correct search.
On Feb 3, 3:50 am, mohammad al-ani alani.moham...@gmail.com wrote:
 Webweave i didn't know how to explain my problem well because of my poor
 English but to know what i mean with my problem just open your tiny url

 http://tinyurl.com/b8fl58

 and with that the firefox request will be in the utf-8 encoding but if you
 click on the firefox address bar and press enter to re-request the page the
 firefox will encode the مقال word to the %E3%DE%C7%E1 which is encoded with
 the windows-1256 encoding . so is there anyway to know the encoding of the
 comming data from the firefox, any function any script for that.

 and thank you again .

 On Tue, Feb 3, 2009 at 12:02 AM, Webweave webwe...@gmail.com wrote:

  Well, that to me would seem to mean that you are indeed trying to
  access the page from a page that is not defined as UTF-8.

  From Firefox, if I type مقال into the Google search box, I get a
  return search of
 http://www.google.com/search?q=مقالie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-ahttp://www.google.com/search?q=%D9%85%D9%82%D8%A7%D9%84ie=utf-8oe=u...

  So wherever you are inputting the string, it is getting translated
  incorrectly (which to me means it's not UTF-8).

  See:http://tinyurl.com/b8fl58

  If you load up Firebug, you should be able to look at the Response
  headers and see the Content-Type of text/html; charset=UTF-8

  On Feb 2, 11:21 am, mohammad al-ani alani.moham...@gmail.com wrote:
   thank you Dr. Loboto but i find the real problem.

   i develop the site under firefox so if i use the internet explorer i can
  get
   the arabic word like it it but when i use the firefox and search for word
   like مقال the address of firefox will be

   /search?keyword=مقال

   and when i just confirm this link by press enter on it the firefox
  converted
   the link to

  http://www.localhost.com/alsameriae/search?keyword=%E3%DE%C7%E1

   which will cuase the problem so is there any way to check form the
  encoding
   type

   On Mon, Feb 2, 2009 at 6:38 AM, Dr. Loboto drlob...@gmail.com wrote:

Your problem is caused by wrong page encoding. Follow Marcelo Andrade
checklist to eliminate wrong encoding on all steps. Everywhere should
be UTF-8 and URL will be in UTF-8 too. Or you use some unknown really
stupid browser that can't handle UTF-8 at all - but I can't imagine
such a browser in present time.

On Feb 1, 3:02 pm, mohammad al-ani alani.moham...@gmail.com wrote:
 thank you all for your time and help

 but my problem actually is caused by the browser . he send the url
  query
to
 the cakephp in the form of ANSI and i configure the cake and the
  header
of
 generated page to use the utf-8 so the quastion is how to change the
recived
 ansi data to the utf-8 data it's not about notpad++ it's about
  dynamic
read
 write data

 On Fri, Jan 30, 2009 at 6:54 PM, Marcelo Andrade 
  mfandr...@gmail.com
wrote:

  On Thu, Jan 29, 2009 at 7:18 PM, medo alani.moham...@gmail.com
wrote:
   (..)

  This is a very common issue.  Just follow this checklist:

  1. Using a smart editor (for Windows: Notepad++, Textpad, ...; for
  Gnu/Linux: Gedit,
  Kedit, Geany, Kate, Vim...), be sure that all of your .php and .ctp
  files are saved
  with the UTF-8 (without BOM) encoding;

  2. Be sure that your webserver is configured to serve the pages in
  UTF-8 encoding
  (in Apache, the line 'AddDefaultCharset UTF-8' in your httpd.conf);

  3. Be sure that your database tables are configured with the UTF-8
encoding
  (in
  MySql, create your tables with the proper collation option);

  4. In the very last case, if the problem still persists and your
  are a
  really paranoid,
  change the PHP interpreter encoding in your php.ini.

  Best regards.

  --
  MARCELO DE F. ANDRADE (aka eleKtron)
  Belem, PA, Amazonia, Brazil
  Linux User #221105

  [...@pará ~]# linkshttp://pa.slackwarebrasil.org/

  For Libby's backstory be told on Lost
 http://www.petitiononline.com/libby423/petition.html


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this 

Re: utf-8 encoding problem

2009-02-03 Thread Marcelo Andrade

On Tue, Feb 3, 2009 at 8:55 AM, mohammad al-ani
alani.moham...@gmail.com wrote:
 Dr. Loboto all of my pages encoded with utf-8 and the problem is not in my
 page the problem is with the firefox and everything go perfect with IE

It works on IE because the CP-1252 encoding is a Windows-specific encoding
that works primarily on the Microsoft products.  Unless you intend to make your
pages working only on IE, don't use it.

To solve your problem, open all of your files in a smart text editor and resave
all of them with the UTF-8 (without BOM) encoding.  Check your editor about
doing this.

Best regards.

--
MARCELO DE F. ANDRADE (aka eleKtron)
Belem, PA, Amazonia, Brazil
Linux User #221105

[...@pará ~]# links http://pa.slackwarebrasil.org/

For Libby's backstory be told on Lost
http://www.petitiononline.com/libby423/petition.html

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-02-03 Thread mohammad al-ani
Webweave i didn't know how to explain my problem well because of my poor
English but to know what i mean with my problem just open your tiny url

http://tinyurl.com/b8fl58

and with that the firefox request will be in the utf-8 encoding but if you
click on the firefox address bar and press enter to re-request the page the
firefox will encode the مقال word to the %E3%DE%C7%E1 which is encoded with
the windows-1256 encoding . so is there anyway to know the encoding of the
comming data from the firefox, any function any script for that.

and thank you again .

On Tue, Feb 3, 2009 at 12:02 AM, Webweave webwe...@gmail.com wrote:


 Well, that to me would seem to mean that you are indeed trying to
 access the page from a page that is not defined as UTF-8.

 From Firefox, if I type مقال into the Google search box, I get a
 return search of
 http://www.google.com/search?q=مقالie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-ahttp://www.google.com/search?q=%D9%85%D9%82%D8%A7%D9%84ie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-a

 So wherever you are inputting the string, it is getting translated
 incorrectly (which to me means it's not UTF-8).

 See: http://tinyurl.com/b8fl58

 If you load up Firebug, you should be able to look at the Response
 headers and see the Content-Type of text/html; charset=UTF-8


 On Feb 2, 11:21 am, mohammad al-ani alani.moham...@gmail.com wrote:
  thank you Dr. Loboto but i find the real problem.
 
  i develop the site under firefox so if i use the internet explorer i can
 get
  the arabic word like it it but when i use the firefox and search for word
  like مقال the address of firefox will be
 
  /search?keyword=مقال
 
  and when i just confirm this link by press enter on it the firefox
 converted
  the link to
 
  http://www.localhost.com/alsameriae/search?keyword=%E3%DE%C7%E1
 
  which will cuase the problem so is there any way to check form the
 encoding
  type
 
  On Mon, Feb 2, 2009 at 6:38 AM, Dr. Loboto drlob...@gmail.com wrote:
 
   Your problem is caused by wrong page encoding. Follow Marcelo Andrade
   checklist to eliminate wrong encoding on all steps. Everywhere should
   be UTF-8 and URL will be in UTF-8 too. Or you use some unknown really
   stupid browser that can't handle UTF-8 at all - but I can't imagine
   such a browser in present time.
 
   On Feb 1, 3:02 pm, mohammad al-ani alani.moham...@gmail.com wrote:
thank you all for your time and help
 
but my problem actually is caused by the browser . he send the url
 query
   to
the cakephp in the form of ANSI and i configure the cake and the
 header
   of
generated page to use the utf-8 so the quastion is how to change the
   recived
ansi data to the utf-8 data it's not about notpad++ it's about
 dynamic
   read
write data
 
On Fri, Jan 30, 2009 at 6:54 PM, Marcelo Andrade 
 mfandr...@gmail.com
   wrote:
 
 On Thu, Jan 29, 2009 at 7:18 PM, medo alani.moham...@gmail.com
   wrote:
  (..)
 
 This is a very common issue.  Just follow this checklist:
 
 1. Using a smart editor (for Windows: Notepad++, Textpad, ...; for
 Gnu/Linux: Gedit,
 Kedit, Geany, Kate, Vim...), be sure that all of your .php and .ctp
 files are saved
 with the UTF-8 (without BOM) encoding;
 
 2. Be sure that your webserver is configured to serve the pages in
 UTF-8 encoding
 (in Apache, the line 'AddDefaultCharset UTF-8' in your httpd.conf);
 
 3. Be sure that your database tables are configured with the UTF-8
   encoding
 (in
 MySql, create your tables with the proper collation option);
 
 4. In the very last case, if the problem still persists and your
 are a
 really paranoid,
 change the PHP interpreter encoding in your php.ini.
 
 Best regards.
 
 --
 MARCELO DE F. ANDRADE (aka eleKtron)
 Belem, PA, Amazonia, Brazil
 Linux User #221105
 
 [...@pará ~]# linkshttp://pa.slackwarebrasil.org/
 
 For Libby's backstory be told on Lost
http://www.petitiononline.com/libby423/petition.html
 
 
 


--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-02-03 Thread BrendonKoz

While on this subject, which MySQL table encoding is the normal,
default utf-8 encoding?  utf8_bin, or utf8_general_ci, or
utf8_unicode_ci?

On Feb 3, 8:48 am, Marcelo Andrade mfandr...@gmail.com wrote:
 On Tue, Feb 3, 2009 at 8:55 AM, mohammad al-ani

 alani.moham...@gmail.com wrote:
  Dr. Loboto all of my pages encoded with utf-8 and the problem is not in my
  page the problem is with the firefox and everything go perfect with IE

 It works on IE because the CP-1252 encoding is a Windows-specific encoding
 that works primarily on the Microsoft products.  Unless you intend to make 
 your
 pages working only on IE, don't use it.

 To solve your problem, open all of your files in a smart text editor and 
 resave
 all of them with the UTF-8 (without BOM) encoding.  Check your editor about
 doing this.

 Best regards.

 --
 MARCELO DE F. ANDRADE (aka eleKtron)
 Belem, PA, Amazonia, Brazil
 Linux User #221105

 [...@pará ~]# linkshttp://pa.slackwarebrasil.org/

 For Libby's backstory be told on 
 Losthttp://www.petitiononline.com/libby423/petition.html
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-02-03 Thread Webweave

The ci flavors are for case-insensitive versions, so if you want
John to be equal to john with no case conversion, you use one of
them.

The utf8_bin is the normal collation.

On Feb 3, 10:28 am, BrendonKoz brendon...@hotmail.com wrote:
 While on this subject, which MySQL table encoding is the normal,
 default utf-8 encoding?  utf8_bin, or utf8_general_ci, or
 utf8_unicode_ci?

 On Feb 3, 8:48 am, Marcelo Andrade mfandr...@gmail.com wrote:

  On Tue, Feb 3, 2009 at 8:55 AM, mohammad al-ani

  alani.moham...@gmail.com wrote:
   Dr. Loboto all of my pages encoded with utf-8 and the problem is not in my
   page the problem is with the firefox and everything go perfect with IE

  It works on IE because the CP-1252 encoding is a Windows-specific encoding
  that works primarily on the Microsoft products.  Unless you intend to make 
  your
  pages working only on IE, don't use it.

  To solve your problem, open all of your files in a smart text editor and 
  resave
  all of them with the UTF-8 (without BOM) encoding.  Check your editor about
  doing this.

  Best regards.

  --
  MARCELO DE F. ANDRADE (aka eleKtron)
  Belem, PA, Amazonia, Brazil
  Linux User #221105

  [...@pará ~]# linkshttp://pa.slackwarebrasil.org/

  For Libby's backstory be told on 
  Losthttp://www.petitiononline.com/libby423/petition.html


--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-02-02 Thread mohammad al-ani
thank you Dr. Loboto but i find the real problem.

i develop the site under firefox so if i use the internet explorer i can get
the arabic word like it it but when i use the firefox and search for word
like مقال the address of firefox will be

/search?keyword=مقال

and when i just confirm this link by press enter on it the firefox converted
the link to

http://www.localhost.com/alsameriae/search?keyword=%E3%DE%C7%E1

which will cuase the problem so is there any way to check form the encoding
type


On Mon, Feb 2, 2009 at 6:38 AM, Dr. Loboto drlob...@gmail.com wrote:


 Your problem is caused by wrong page encoding. Follow Marcelo Andrade
 checklist to eliminate wrong encoding on all steps. Everywhere should
 be UTF-8 and URL will be in UTF-8 too. Or you use some unknown really
 stupid browser that can't handle UTF-8 at all - but I can't imagine
 such a browser in present time.

 On Feb 1, 3:02 pm, mohammad al-ani alani.moham...@gmail.com wrote:
  thank you all for your time and help
 
  but my problem actually is caused by the browser . he send the url query
 to
  the cakephp in the form of ANSI and i configure the cake and the header
 of
  generated page to use the utf-8 so the quastion is how to change the
 recived
  ansi data to the utf-8 data it's not about notpad++ it's about dynamic
 read
  write data
 
  On Fri, Jan 30, 2009 at 6:54 PM, Marcelo Andrade mfandr...@gmail.com
 wrote:
 
 
 
   On Thu, Jan 29, 2009 at 7:18 PM, medo alani.moham...@gmail.com
 wrote:
(..)
 
   This is a very common issue.  Just follow this checklist:
 
   1. Using a smart editor (for Windows: Notepad++, Textpad, ...; for
   Gnu/Linux: Gedit,
   Kedit, Geany, Kate, Vim...), be sure that all of your .php and .ctp
   files are saved
   with the UTF-8 (without BOM) encoding;
 
   2. Be sure that your webserver is configured to serve the pages in
   UTF-8 encoding
   (in Apache, the line 'AddDefaultCharset UTF-8' in your httpd.conf);
 
   3. Be sure that your database tables are configured with the UTF-8
 encoding
   (in
   MySql, create your tables with the proper collation option);
 
   4. In the very last case, if the problem still persists and your are a
   really paranoid,
   change the PHP interpreter encoding in your php.ini.
 
   Best regards.
 
   --
   MARCELO DE F. ANDRADE (aka eleKtron)
   Belem, PA, Amazonia, Brazil
   Linux User #221105
 
   [...@pará ~]# linkshttp://pa.slackwarebrasil.org/
 
   For Libby's backstory be told on Lost
  http://www.petitiononline.com/libby423/petition.html
 


--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-02-02 Thread Webweave

Well, that to me would seem to mean that you are indeed trying to
access the page from a page that is not defined as UTF-8.

From Firefox, if I type مقال into the Google search box, I get a
return search of 
http://www.google.com/search?q=مقالie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-a

So wherever you are inputting the string, it is getting translated
incorrectly (which to me means it's not UTF-8).

See: http://tinyurl.com/b8fl58

If you load up Firebug, you should be able to look at the Response
headers and see the Content-Type of text/html; charset=UTF-8


On Feb 2, 11:21 am, mohammad al-ani alani.moham...@gmail.com wrote:
 thank you Dr. Loboto but i find the real problem.

 i develop the site under firefox so if i use the internet explorer i can get
 the arabic word like it it but when i use the firefox and search for word
 like مقال the address of firefox will be

 /search?keyword=مقال

 and when i just confirm this link by press enter on it the firefox converted
 the link to

 http://www.localhost.com/alsameriae/search?keyword=%E3%DE%C7%E1

 which will cuase the problem so is there any way to check form the encoding
 type

 On Mon, Feb 2, 2009 at 6:38 AM, Dr. Loboto drlob...@gmail.com wrote:

  Your problem is caused by wrong page encoding. Follow Marcelo Andrade
  checklist to eliminate wrong encoding on all steps. Everywhere should
  be UTF-8 and URL will be in UTF-8 too. Or you use some unknown really
  stupid browser that can't handle UTF-8 at all - but I can't imagine
  such a browser in present time.

  On Feb 1, 3:02 pm, mohammad al-ani alani.moham...@gmail.com wrote:
   thank you all for your time and help

   but my problem actually is caused by the browser . he send the url query
  to
   the cakephp in the form of ANSI and i configure the cake and the header
  of
   generated page to use the utf-8 so the quastion is how to change the
  recived
   ansi data to the utf-8 data it's not about notpad++ it's about dynamic
  read
   write data

   On Fri, Jan 30, 2009 at 6:54 PM, Marcelo Andrade mfandr...@gmail.com
  wrote:

On Thu, Jan 29, 2009 at 7:18 PM, medo alani.moham...@gmail.com
  wrote:
 (..)

This is a very common issue.  Just follow this checklist:

1. Using a smart editor (for Windows: Notepad++, Textpad, ...; for
Gnu/Linux: Gedit,
Kedit, Geany, Kate, Vim...), be sure that all of your .php and .ctp
files are saved
with the UTF-8 (without BOM) encoding;

2. Be sure that your webserver is configured to serve the pages in
UTF-8 encoding
(in Apache, the line 'AddDefaultCharset UTF-8' in your httpd.conf);

3. Be sure that your database tables are configured with the UTF-8
  encoding
(in
MySql, create your tables with the proper collation option);

4. In the very last case, if the problem still persists and your are a
really paranoid,
change the PHP interpreter encoding in your php.ini.

Best regards.

--
MARCELO DE F. ANDRADE (aka eleKtron)
Belem, PA, Amazonia, Brazil
Linux User #221105

[...@pará ~]# linkshttp://pa.slackwarebrasil.org/

For Libby's backstory be told on Lost
   http://www.petitiononline.com/libby423/petition.html


--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-02-02 Thread Dr. Loboto

Mohammad Al-Ani, you really found your real problem - your page is not
UTF-8 page! %xx form is url-encoded non-ANSI string as only 7-bit
symbols can be used in URLs. That's why browers encode non-ANSI
symbols and then they are automatically decoded by Cake before go into
params. Some of browsers show encoded string in address bar and you
see %xx string, some - not encoded and you see real word. Word %E3%DE
%C7%E1 you saw in Firefox is wrong word, possibly encoded using
windows-1256 as you indicated above. But Cake expects UTF-8, and real
word in url-encoded form should looks like %D9%85%D9%82%D8%A7%D9%84

Correct all your pages encodings to UTF-8 and problem will go away!

On Feb 3, 1:21 am, mohammad al-ani alani.moham...@gmail.com wrote:
 thank you Dr. Loboto but i find the real problem.

 i develop the site under firefox so if i use the internet explorer i can get
 the arabic word like it it but when i use the firefox and search for word
 like مقال the address of firefox will be

 /search?keyword=مقال

 and when i just confirm this link by press enter on it the firefox converted
 the link to

 http://www.localhost.com/alsameriae/search?keyword=%E3%DE%C7%E1

 which will cuase the problem so is there any way to check form the encoding
 type

 On Mon, Feb 2, 2009 at 6:38 AM, Dr. Loboto drlob...@gmail.com wrote:

  Your problem is caused by wrong page encoding. Follow Marcelo Andrade
  checklist to eliminate wrong encoding on all steps. Everywhere should
  be UTF-8 and URL will be in UTF-8 too. Or you use some unknown really
  stupid browser that can't handle UTF-8 at all - but I can't imagine
  such a browser in present time.

  On Feb 1, 3:02 pm, mohammad al-ani alani.moham...@gmail.com wrote:
   thank you all for your time and help

   but my problem actually is caused by the browser . he send the url query
  to
   the cakephp in the form of ANSI and i configure the cake and the header
  of
   generated page to use the utf-8 so the quastion is how to change the
  recived
   ansi data to the utf-8 data it's not about notpad++ it's about dynamic
  read
   write data

   On Fri, Jan 30, 2009 at 6:54 PM, Marcelo Andrade mfandr...@gmail.com
  wrote:

On Thu, Jan 29, 2009 at 7:18 PM, medo alani.moham...@gmail.com
  wrote:
 (..)

This is a very common issue.  Just follow this checklist:

1. Using a smart editor (for Windows: Notepad++, Textpad, ...; for
Gnu/Linux: Gedit,
Kedit, Geany, Kate, Vim...), be sure that all of your .php and .ctp
files are saved
with the UTF-8 (without BOM) encoding;

2. Be sure that your webserver is configured to serve the pages in
UTF-8 encoding
(in Apache, the line 'AddDefaultCharset UTF-8' in your httpd.conf);

3. Be sure that your database tables are configured with the UTF-8
  encoding
(in
MySql, create your tables with the proper collation option);

4. In the very last case, if the problem still persists and your are a
really paranoid,
change the PHP interpreter encoding in your php.ini.

Best regards.

--
MARCELO DE F. ANDRADE (aka eleKtron)
Belem, PA, Amazonia, Brazil
Linux User #221105

[...@pará ~]# linkshttp://pa.slackwarebrasil.org/

For Libby's backstory be told on Lost
   http://www.petitiononline.com/libby423/petition.html
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-02-01 Thread mohammad al-ani
thank you all for your time and help

but my problem actually is caused by the browser . he send the url query to
the cakephp in the form of ANSI and i configure the cake and the header of
generated page to use the utf-8 so the quastion is how to change the recived
ansi data to the utf-8 data it's not about notpad++ it's about dynamic read
write data

On Fri, Jan 30, 2009 at 6:54 PM, Marcelo Andrade mfandr...@gmail.comwrote:


 On Thu, Jan 29, 2009 at 7:18 PM, medo alani.moham...@gmail.com wrote:
  (..)

 This is a very common issue.  Just follow this checklist:

 1. Using a smart editor (for Windows: Notepad++, Textpad, ...; for
 Gnu/Linux: Gedit,
 Kedit, Geany, Kate, Vim...), be sure that all of your .php and .ctp
 files are saved
 with the UTF-8 (without BOM) encoding;

 2. Be sure that your webserver is configured to serve the pages in
 UTF-8 encoding
 (in Apache, the line 'AddDefaultCharset UTF-8' in your httpd.conf);

 3. Be sure that your database tables are configured with the UTF-8 encoding
 (in
 MySql, create your tables with the proper collation option);

 4. In the very last case, if the problem still persists and your are a
 really paranoid,
 change the PHP interpreter encoding in your php.ini.

 Best regards.

 --
 MARCELO DE F. ANDRADE (aka eleKtron)
 Belem, PA, Amazonia, Brazil
 Linux User #221105

 [...@pará ~]# links http://pa.slackwarebrasil.org/

 For Libby's backstory be told on Lost
 http://www.petitiononline.com/libby423/petition.html

 


--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-02-01 Thread Dr. Loboto

Your problem is caused by wrong page encoding. Follow Marcelo Andrade
checklist to eliminate wrong encoding on all steps. Everywhere should
be UTF-8 and URL will be in UTF-8 too. Or you use some unknown really
stupid browser that can't handle UTF-8 at all - but I can't imagine
such a browser in present time.

On Feb 1, 3:02 pm, mohammad al-ani alani.moham...@gmail.com wrote:
 thank you all for your time and help

 but my problem actually is caused by the browser . he send the url query to
 the cakephp in the form of ANSI and i configure the cake and the header of
 generated page to use the utf-8 so the quastion is how to change the recived
 ansi data to the utf-8 data it's not about notpad++ it's about dynamic read
 write data

 On Fri, Jan 30, 2009 at 6:54 PM, Marcelo Andrade mfandr...@gmail.comwrote:



  On Thu, Jan 29, 2009 at 7:18 PM, medo alani.moham...@gmail.com wrote:
   (..)

  This is a very common issue.  Just follow this checklist:

  1. Using a smart editor (for Windows: Notepad++, Textpad, ...; for
  Gnu/Linux: Gedit,
  Kedit, Geany, Kate, Vim...), be sure that all of your .php and .ctp
  files are saved
  with the UTF-8 (without BOM) encoding;

  2. Be sure that your webserver is configured to serve the pages in
  UTF-8 encoding
  (in Apache, the line 'AddDefaultCharset UTF-8' in your httpd.conf);

  3. Be sure that your database tables are configured with the UTF-8 encoding
  (in
  MySql, create your tables with the proper collation option);

  4. In the very last case, if the problem still persists and your are a
  really paranoid,
  change the PHP interpreter encoding in your php.ini.

  Best regards.

  --
  MARCELO DE F. ANDRADE (aka eleKtron)
  Belem, PA, Amazonia, Brazil
  Linux User #221105

  [...@pará ~]# linkshttp://pa.slackwarebrasil.org/

  For Libby's backstory be told on Lost
 http://www.petitiononline.com/libby423/petition.html
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-01-30 Thread Webweave

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.comwrote:

  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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-01-30 Thread mohammad al-ani
please any suggestions

On Fri, Jan 30, 2009 at 10:48 AM, mohammad al-ani
alani.moham...@gmail.comwrote:

 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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-01-30 Thread Marcelo Andrade

On Thu, Jan 29, 2009 at 7:18 PM, medo alani.moham...@gmail.com wrote:
 (..)

This is a very common issue.  Just follow this checklist:

1. Using a smart editor (for Windows: Notepad++, Textpad, ...; for
Gnu/Linux: Gedit,
Kedit, Geany, Kate, Vim...), be sure that all of your .php and .ctp
files are saved
with the UTF-8 (without BOM) encoding;

2. Be sure that your webserver is configured to serve the pages in
UTF-8 encoding
(in Apache, the line 'AddDefaultCharset UTF-8' in your httpd.conf);

3. Be sure that your database tables are configured with the UTF-8 encoding (in
MySql, create your tables with the proper collation option);

4. In the very last case, if the problem still persists and your are a
really paranoid,
change the PHP interpreter encoding in your php.ini.

Best regards.

--
MARCELO DE F. ANDRADE (aka eleKtron)
Belem, PA, Amazonia, Brazil
Linux User #221105

[...@pará ~]# links http://pa.slackwarebrasil.org/

For Libby's backstory be told on Lost
http://www.petitiononline.com/libby423/petition.html

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



utf-8 encoding problem

2009-01-29 Thread medo

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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-01-29 Thread brian

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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-01-29 Thread mohammad al-ani
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: utf-8 encoding problem

2009-01-29 Thread mohammad al-ani
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.comwrote:

 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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Encoding problem with helpers

2009-01-23 Thread dr. Hannibal Lecter

1. Make sure everything in your database is utf8 (or other encoding
needed).
2. Make sure you're connecting to your database with utf8[1].
3. Make sure your pages are served in utf8.

[1] 
http://groups.google.com/group/cake-php/browse_thread/thread/dcdbcc085dcd09a0

Hope that helps!

On Jan 22, 11:04 pm, ABY bno...@gmail.com wrote:
 hi,
 i am currently developing an application with CakePHP, but i have a
 serious problem with encoding. my database records are in Turkish.
 when i view a record, there is no problem and i can view Turkish
 characters. but when i try to edit a record, all fields that contain
 at least a Turkish character are just empty. for example when i set a
 new variable like

 $var = $this-data in the controller,
 in edit.ctp i can display the $var correctly (by pr() command), but
 the edit form that i create using $form helper does not display the
 fields with Turkish characters.

 i have the same problem with $html helper. for example;
 echo $post['title'] displays çağrı,but
 $html-link($post['title'], '/posts') displays nothing..

 can somebody help me with that problem please. i have been trying to
 fix it for hours by changing database encodings, but it didin't work
 out..

 thanks
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Encoding problem with helpers

2009-01-23 Thread ABY

i just solved the problem by encoding all data and html in utf-8.
thanks so much for your help.

On Jan 22, 8:16 pm, brian bally.z...@gmail.com wrote:
 First thing is to make sure that the page with the form is being
 served with the proper encoding. Use $html-charset() in your layout.
 The form should submit using the character set that it was displayed
 with.

 Next, make sure that that's what your browser is using--check page
 info in the browser.

 Also, you say that $post['title'] is empty, but could this be due to
 some other issue? Are you sure that $post contains what you think it
 does?

 2009/1/22 ABY bno...@gmail.com:



  hi,
  i am currently developing an application with CakePHP, but i have a
  serious problem with encoding. my database records are in Turkish.
  when i view a record, there is no problem and i can view Turkish
  characters. but when i try to edit a record, all fields that contain
  at least a Turkish character are just empty. for example when i set a
  new variable like

  $var = $this-data in the controller,
  in edit.ctp i can display the $var correctly (by pr() command), but
  the edit form that i create using $form helper does not display the
  fields with Turkish characters.

  i have the same problem with $html helper. for example;
  echo $post['title'] displays çağrı,but
  $html-link($post['title'], '/posts') displays nothing..

  can somebody help me with that problem please. i have been trying to
  fix it for hours by changing database encodings, but it didin't work
  out..

  thanks

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Encoding problem with helpers

2009-01-22 Thread ABY

hi,
i am currently developing an application with CakePHP, but i have a
serious problem with encoding. my database records are in Turkish.
when i view a record, there is no problem and i can view Turkish
characters. but when i try to edit a record, all fields that contain
at least a Turkish character are just empty. for example when i set a
new variable like

$var = $this-data in the controller,
in edit.ctp i can display the $var correctly (by pr() command), but
the edit form that i create using $form helper does not display the
fields with Turkish characters.

i have the same problem with $html helper. for example;
echo $post['title'] displays çağrı,but
$html-link($post['title'], '/posts') displays nothing..

can somebody help me with that problem please. i have been trying to
fix it for hours by changing database encodings, but it didin't work
out..

thanks

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Encoding problem with helpers

2009-01-22 Thread brian

First thing is to make sure that the page with the form is being
served with the proper encoding. Use $html-charset() in your layout.
The form should submit using the character set that it was displayed
with.

Next, make sure that that's what your browser is using--check page
info in the browser.

Also, you say that $post['title'] is empty, but could this be due to
some other issue? Are you sure that $post contains what you think it
does?

2009/1/22 ABY bno...@gmail.com:

 hi,
 i am currently developing an application with CakePHP, but i have a
 serious problem with encoding. my database records are in Turkish.
 when i view a record, there is no problem and i can view Turkish
 characters. but when i try to edit a record, all fields that contain
 at least a Turkish character are just empty. for example when i set a
 new variable like

 $var = $this-data in the controller,
 in edit.ctp i can display the $var correctly (by pr() command), but
 the edit form that i create using $form helper does not display the
 fields with Turkish characters.

 i have the same problem with $html helper. for example;
 echo $post['title'] displays çağrı,but
 $html-link($post['title'], '/posts') displays nothing..

 can somebody help me with that problem please. i have been trying to
 fix it for hours by changing database encodings, but it didin't work
 out..

 thanks

 


--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---