Weird behavior with characters
Hello guys, I'm having a strange behavior from cakePHP, which i'll try to explain. I have the following scenario: - I have two environments: one is my local machine (actually, two machines for developing), where i actually do the development, and the second one is the server where i send the application. Both are the same, except that the server i have Linux running, and one development machine runs windows XP and the other runs Linux; - My database and all its tables are set up to charset UTF-8. They are the same in the server and in the development machines; - I have some table fields filled with accented characters; Now, the problem is: In the development machines, when i try to edit a record in any table, and this record is accented in any part, it's ok, no big deal. But, in the server, if i try to edit this same record, the fields which have an accented character is not filled in the form. It's just blank! Things i have checked: - I already checked the HTML source, and the value is empty. - In the controller, after reading the record to edit, i write the $this-data to a log file, and the records with accented characters are there. - If i set a variable like $this-set('tmpClient', $this-data); and echo the $tmpClient in the view, i can see the fields which have accented characters. Well, i'm still searching for a solution for this problem, but if anybody have a clue, i would love to hear it!!! Let me know if i didn't make myself clear! Best regards, Luiz Poleto --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Weird behavior with characters
tried to set your source code files encoding to UTF-8? The default of many IDEs is to set them as ISO-8859-1, wich messes up with accented chars, make sure you are rendering your content in UTF-8 too. But anyway, I would like to point that it's not a good idea, accented chars are generally a pain the back to handle in source code, and they are not even allowed in HTML, so your views are probably going to render in quirks mode, or you are just messing with your code validation. You are better off using l10n in views to display them with accented chars. On 24 set, 14:46, Luiz Poleto [EMAIL PROTECTED] wrote: Hello guys, I'm having a strange behavior from cakePHP, which i'll try to explain. I have the following scenario: - I have two environments: one is my local machine (actually, two machines for developing), where i actually do the development, and the second one is the server where i send the application. Both are the same, except that the server i have Linux running, and one development machine runs windows XP and the other runs Linux; - My database and all its tables are set up to charset UTF-8. They are the same in the server and in the development machines; - I have some table fields filled with accented characters; Now, the problem is: In the development machines, when i try to edit a record in any table, and this record is accented in any part, it's ok, no big deal. But, in the server, if i try to edit this same record, the fields which have an accented character is not filled in the form. It's just blank! Things i have checked: - I already checked the HTML source, and the value is empty. - In the controller, after reading the record to edit, i write the $this-data to a log file, and the records with accented characters are there. - If i set a variable like $this-set('tmpClient', $this-data); and echo the $tmpClient in the view, i can see the fields which have accented characters. Well, i'm still searching for a solution for this problem, but if anybody have a clue, i would love to hear it!!! Let me know if i didn't make myself clear! Best regards, Luiz Poleto --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Weird behavior with characters
Actually, there is no accented chars in the source code. Those chars come from the database, some records have fields with accented chars.The problem happens when cake fill the html fields with those values. For example: The code: echo $form-hidden('Model.field'); will generate something like this in the html: input type=hidden id=ModelField name=data[Model][field] value=value_from_database / But the database record which is accented brings me something like this: input type=hidden id=ModelField name=data[Model][field] value= / note that the VALUE property is empty. The strange thing is that it happens in the server only, in my local machines it just works. Regards, Luiz Poleto 2008/9/24 Rafael Bandeira aka rafaelbandeira3 [EMAIL PROTECTED] tried to set your source code files encoding to UTF-8? The default of many IDEs is to set them as ISO-8859-1, wich messes up with accented chars, make sure you are rendering your content in UTF-8 too. But anyway, I would like to point that it's not a good idea, accented chars are generally a pain the back to handle in source code, and they are not even allowed in HTML, so your views are probably going to render in quirks mode, or you are just messing with your code validation. You are better off using l10n in views to display them with accented chars. On 24 set, 14:46, Luiz Poleto [EMAIL PROTECTED] wrote: Hello guys, I'm having a strange behavior from cakePHP, which i'll try to explain. I have the following scenario: - I have two environments: one is my local machine (actually, two machines for developing), where i actually do the development, and the second one is the server where i send the application. Both are the same, except that the server i have Linux running, and one development machine runs windows XP and the other runs Linux; - My database and all its tables are set up to charset UTF-8. They are the same in the server and in the development machines; - I have some table fields filled with accented characters; Now, the problem is: In the development machines, when i try to edit a record in any table, and this record is accented in any part, it's ok, no big deal. But, in the server, if i try to edit this same record, the fields which have an accented character is not filled in the form. It's just blank! Things i have checked: - I already checked the HTML source, and the value is empty. - In the controller, after reading the record to edit, i write the $this-data to a log file, and the records with accented characters are there. - If i set a variable like $this-set('tmpClient', $this-data); and echo the $tmpClient in the view, i can see the fields which have accented characters. Well, i'm still searching for a solution for this problem, but if anybody have a clue, i would love to hear it!!! Let me know if i didn't make myself clear! Best regards, Luiz Poleto --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Weird behavior with characters
Well, just updating the info, i've just checked that in my local linux computer the problem also happens. So, looks like it's related to the way Linux handle those chars. Any ideas? Regards, Luiz Poleto 2008/9/24 Luiz Poleto [EMAIL PROTECTED] Actually, there is no accented chars in the source code. Those chars come from the database, some records have fields with accented chars.The problem happens when cake fill the html fields with those values. For example: The code: echo $form-hidden('Model.field'); will generate something like this in the html: input type=hidden id=ModelField name=data[Model][field] value=value_from_database / But the database record which is accented brings me something like this: input type=hidden id=ModelField name=data[Model][field] value= / note that the VALUE property is empty. The strange thing is that it happens in the server only, in my local machines it just works. Regards, Luiz Poleto 2008/9/24 Rafael Bandeira aka rafaelbandeira3 [EMAIL PROTECTED] tried to set your source code files encoding to UTF-8? The default of many IDEs is to set them as ISO-8859-1, wich messes up with accented chars, make sure you are rendering your content in UTF-8 too. But anyway, I would like to point that it's not a good idea, accented chars are generally a pain the back to handle in source code, and they are not even allowed in HTML, so your views are probably going to render in quirks mode, or you are just messing with your code validation. You are better off using l10n in views to display them with accented chars. On 24 set, 14:46, Luiz Poleto [EMAIL PROTECTED] wrote: Hello guys, I'm having a strange behavior from cakePHP, which i'll try to explain. I have the following scenario: - I have two environments: one is my local machine (actually, two machines for developing), where i actually do the development, and the second one is the server where i send the application. Both are the same, except that the server i have Linux running, and one development machine runs windows XP and the other runs Linux; - My database and all its tables are set up to charset UTF-8. They are the same in the server and in the development machines; - I have some table fields filled with accented characters; Now, the problem is: In the development machines, when i try to edit a record in any table, and this record is accented in any part, it's ok, no big deal. But, in the server, if i try to edit this same record, the fields which have an accented character is not filled in the form. It's just blank! Things i have checked: - I already checked the HTML source, and the value is empty. - In the controller, after reading the record to edit, i write the $this-data to a log file, and the records with accented characters are there. - If i set a variable like $this-set('tmpClient', $this-data); and echo the $tmpClient in the view, i can see the fields which have accented characters. Well, i'm still searching for a solution for this problem, but if anybody have a clue, i would love to hear it!!! Let me know if i didn't make myself clear! Best regards, Luiz Poleto --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Weird behavior with characters
Ok. I've just found out what the problem was: - My database and its tables where setup to charset = utf-8. - my html tag was setup to ISO-8859-1. when we did the insert in the database, i guess the fields were passed to the server as iso-8859-1 encoding, and saved this way in the database. Changing the html encoding to utf-8 solved the problem for new inserted records. Now i have to convert all data already existing in the database as utf-8. regards, LP 2008/9/25 Luiz Poleto [EMAIL PROTECTED] Well, just updating the info, i've just checked that in my local linux computer the problem also happens. So, looks like it's related to the way Linux handle those chars. Any ideas? Regards, Luiz Poleto 2008/9/24 Luiz Poleto [EMAIL PROTECTED] Actually, there is no accented chars in the source code. Those chars come from the database, some records have fields with accented chars.The problem happens when cake fill the html fields with those values. For example: The code: echo $form-hidden('Model.field'); will generate something like this in the html: input type=hidden id=ModelField name=data[Model][field] value=value_from_database / But the database record which is accented brings me something like this: input type=hidden id=ModelField name=data[Model][field] value= / note that the VALUE property is empty. The strange thing is that it happens in the server only, in my local machines it just works. Regards, Luiz Poleto 2008/9/24 Rafael Bandeira aka rafaelbandeira3 [EMAIL PROTECTED] tried to set your source code files encoding to UTF-8? The default of many IDEs is to set them as ISO-8859-1, wich messes up with accented chars, make sure you are rendering your content in UTF-8 too. But anyway, I would like to point that it's not a good idea, accented chars are generally a pain the back to handle in source code, and they are not even allowed in HTML, so your views are probably going to render in quirks mode, or you are just messing with your code validation. You are better off using l10n in views to display them with accented chars. On 24 set, 14:46, Luiz Poleto [EMAIL PROTECTED] wrote: Hello guys, I'm having a strange behavior from cakePHP, which i'll try to explain. I have the following scenario: - I have two environments: one is my local machine (actually, two machines for developing), where i actually do the development, and the second one is the server where i send the application. Both are the same, except that the server i have Linux running, and one development machine runs windows XP and the other runs Linux; - My database and all its tables are set up to charset UTF-8. They are the same in the server and in the development machines; - I have some table fields filled with accented characters; Now, the problem is: In the development machines, when i try to edit a record in any table, and this record is accented in any part, it's ok, no big deal. But, in the server, if i try to edit this same record, the fields which have an accented character is not filled in the form. It's just blank! Things i have checked: - I already checked the HTML source, and the value is empty. - In the controller, after reading the record to edit, i write the $this-data to a log file, and the records with accented characters are there. - If i set a variable like $this-set('tmpClient', $this-data); and echo the $tmpClient in the view, i can see the fields which have accented characters. Well, i'm still searching for a solution for this problem, but if anybody have a clue, i would love to hear it!!! Let me know if i didn't make myself clear! Best regards, Luiz Poleto --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---