Re: encoding problems: utf-8

2009-08-27 Thread brian

Are you sure your db connection is using UTF-8?

BTW, I noticed an error in my last reply. It should be SET NAMES
'utf8'; (no '-')

On Thu, Aug 27, 2009 at 4:01 AM, danfreak wrote:
>
> the main encoding problem is in a shell script:
>
> The script imports RSS from 10 different sources once every hour and
> stores them in DB.
>
> In order to normalize the grabbed content I use:
> 
> foreach ($feed->get_items() as $item){
>  $myitem['title'] = trim($item->get_title());
>  $myitem['title'] = trim($myitem['title'])!='' ? html_entity_decode
> ($myitem['title'], ENT_QUOTES, 'UTF-8') : $rssFont['name'];
>  $myitem['content'] = $item->get_description();
>  $myitem['link'] = $item->get_permalink();
>  $myitem['pubDate'] = $item->get_date('Y-m-d H:i:s');
>  $myitem['source_id'] = $rssFont['id'];
>  $this->saveRetrievedData($myitem);
> }
> 
>
> This works fine locally, while conversion is not going well remotely
>
> >
>

--~--~-~--~~~---~--~~
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 problems: utf-8

2009-08-27 Thread danfreak

the main encoding problem is in a shell script:

The script imports RSS from 10 different sources once every hour and
stores them in DB.

In order to normalize the grabbed content I use:

foreach ($feed->get_items() as $item){
  $myitem['title'] = trim($item->get_title());
  $myitem['title'] = trim($myitem['title'])!='' ? html_entity_decode
($myitem['title'], ENT_QUOTES, 'UTF-8') : $rssFont['name'];
  $myitem['content'] = $item->get_description();
  $myitem['link'] = $item->get_permalink();
  $myitem['pubDate'] = $item->get_date('Y-m-d H:i:s');
  $myitem['source_id'] = $rssFont['id'];
  $this->saveRetrievedData($myitem);
}


This works fine locally, while conversion is not going well remotely

--~--~-~--~~~---~--~~
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 problems: utf-8

2009-08-26 Thread brian

How are you moving the data between servers? And are you using MySQL?
It can be a real PITA when it comes to UTF-8. I've noticed, for
example, that PHPMyAdmin fails to include a line, 'SET NAMES utf-8' in
the dumps it produces, which can mean that MySQL will b0rk the text
when it's read in.

On Wed, Aug 26, 2009 at 6:18 AM, danfreak wrote:
>
>
> Cheers guys,
>
> well my problem is mainly related to the DB entries.
>
> I'm deploying my application to the production server with capistrano,
> pulling the application from a github (git) repository.
>
> 
> I have teh following DB config:
> 
> var $default = array(
>                'driver' => 'mysql',
>                'persistent' => true,
>                'host' => 'localhost',
>                'login' => 'root',
>                'password' => 'psw',
>                'database' => 'test-db',
>                'encoding' => 'utf8'
>        );
> 
> In my config/core.php I have:
> 
> Configure::write('App.encoding', 'UTF-8');
>
>
> 
> My HTML header is:
> 
> charset('utf-8');?>
>
> The only difference I noticed between the dev and production servers
> is with regard to case handling: dev server is case insensitive, while
> the prod server is case sensitive.
>
> Dan
>
> >
>

--~--~-~--~~~---~--~~
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 problems: utf-8

2009-08-26 Thread danfreak

>From phpinfo()

I have Apache:

HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7

on both servers.


Dev server:

PHP Version 5.2.6
MySQL 5.0.67


Production server:

PHP Version 5.2.5
MySQL 5.0.67

--~--~-~--~~~---~--~~
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 problems: utf-8

2009-08-26 Thread danfreak


Cheers guys,

well my problem is mainly related to the DB entries.

I'm deploying my application to the production server with capistrano,
pulling the application from a github (git) repository.


I have teh following DB config:

var $default = array(
'driver' => 'mysql',
'persistent' => true,
'host' => 'localhost',
'login' => 'root',
'password' => 'psw',
'database' => 'test-db',
'encoding' => 'utf8'
);

In my config/core.php I have:

Configure::write('App.encoding', 'UTF-8');



My HTML header is:

charset('utf-8');?>

The only difference I noticed between the dev and production servers
is with regard to case handling: dev server is case insensitive, while
the prod server is case sensitive.

Dan

--~--~-~--~~~---~--~~
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 problems: utf-8

2009-08-25 Thread Marcelo Andrade

On Tue, Aug 25, 2009 at 9:18 AM, Martin
Westin wrote:
> (..)
> It can be the webserver forcing it's default encoding on html and text
> output.

>From my experience, there's a high probability you're
having this issue.

If you're using Apache webserver on remove machine,
try to add the following line to your .htaccess files:

AddDefaultCharset UTF-8

Best regards.

--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105

http://mfandrade.wordpress.com

--~--~-~--~~~---~--~~
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 problems: utf-8

2009-08-25 Thread Pixelastic

If your sure that :
- Your db encoding is correctly set
- Your files are correctly saved as utf
- You've added the correct $html->charset() in your view

You can try adding a AddDefaultCharset utf-8 to your .htaccess and/or
Configure::write('App.encoding', utf-8') in your bootstrap.php file

On Aug 25, 2:18 pm, Martin Westin  wrote:
> You should try to pin-point it a bit.
> Is the browser receiving the correct encoding in the header?
> Is the problem for static text in the layout or text from the
> database?
> Is the problem there for both old data and new data?
>
> There are many little details that are important since you can
> potentially introduce encoding problems in many different ways.
>
> It can be the webserver forcing it's default encoding on html and text
> output.
> It can be that you used Cakes schema migrations (which do not include
> a lot of encoding info from the database).
> It can also be that the data you migrated to the server got messed up
> in the process.
> It can even be php files messed up by an ftp client.
>
> I have had, probably, every encoding problem imaginable. Bring on the
> details and I'll try to suggest some specific solutions.
>
> /Martin
>
> On Aug 25, 1:55 pm, cakeFreak  wrote:
>
> > Hey guys,
>
> > I have a weird issue!
>
> > On my local machine everithing works fine, while on the remote one I
> > don't get utf-8 encoding working properly.
>
> > - DB is utf8 encoding in both machines
> > - files should be saved with utf-8 encoding on both
>
> > Did you experience similar problems and have any advice?
>
> > Thanks dan
>
>
--~--~-~--~~~---~--~~
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 problems: utf-8

2009-08-25 Thread Martin Westin


You should try to pin-point it a bit.
Is the browser receiving the correct encoding in the header?
Is the problem for static text in the layout or text from the
database?
Is the problem there for both old data and new data?

There are many little details that are important since you can
potentially introduce encoding problems in many different ways.

It can be the webserver forcing it's default encoding on html and text
output.
It can be that you used Cakes schema migrations (which do not include
a lot of encoding info from the database).
It can also be that the data you migrated to the server got messed up
in the process.
It can even be php files messed up by an ftp client.

I have had, probably, every encoding problem imaginable. Bring on the
details and I'll try to suggest some specific solutions.

/Martin

On Aug 25, 1:55 pm, cakeFreak  wrote:
> Hey guys,
>
> I have a weird issue!
>
> On my local machine everithing works fine, while on the remote one I
> don't get utf-8 encoding working properly.
>
> - DB is utf8 encoding in both machines
> - files should be saved with utf-8 encoding on both
>
> Did you experience similar problems and have any advice?
>
> Thanks dan
--~--~-~--~~~---~--~~
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 problems: utf-8

2009-08-25 Thread cakeFreak

Hey guys,

I have a weird issue!

On my local machine everithing works fine, while on the remote one I
don't get utf-8 encoding working properly.

- DB is utf8 encoding in both machines
- files should be saved with utf-8 encoding on both

Did you experience similar problems and have any advice?

Thanks dan
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---