Re: [PHP] Re: languages and PHP



At 12:36 PM -0500 9/28/07, Edward Vermillion wrote:
My question was more mental prodding than anything else. The OP had a function to convert incoming text into UTF-8 before they did anything with it. A couple of folks said that was unnecessary, if you set your form to UTF-8 your incoming data will be in UTF-8 already.

I was just trying to make the point that if you expect your incoming data to be in a certain state in your code you should make sure that it is in that state before you act on it, since you can't guarantee it's source. Checking to make sure the incoming data is in it's expected state is not a waste of time (or unnecessary, or whatever term of derision they picked) but is actually good coding practice.

I pretty much gave up on the thread when I got the reply along the lines of "if it breaks something it's their problem, not mine".

Ed

I still don't see the problem: If you are receiving in UTF-8 and someone sends you something UTF-8 or less, than you can catch it. If, on the other hand you are set up for a lessor charset, then there's no way you can be assured that what they send, you can catch.

If given the choice, use the super-group.

This is too obvious, I must be missing something.

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
.



Relevant Pages

  • Re: [PHP] Re: languages and PHP
    ... your html/form is set to UTF-8 doesn't mean that all your incoming ... data will be UTF-8. ... originating from that page will also be in UTF8. ...
    (php.general)
  • Re: [PHP] Re: languages and PHP
    ... your html/form is set to UTF-8 doesn't mean that all your incoming ... data will be UTF-8. ... If your HTML page was sent in UTF-8, ...
    (php.general)
  • Re: [PHP] Re: languages and PHP
    ... So, what's the problem if you get a character defined by ISO -- it's still within the UTF-8 super-group, right? ... The only problem I see here is IF the user has the char set to display the glyph correctly -- OR am I off on something else that you guys aren't even discussing? ... I was just trying to make the point that if you expect your incoming data to be in a certain state in your code you should make sure that it is in that state before you act on it, since you can't guarantee it's source. ...
    (php.general)
  • Re: [PHP] utf-8 in $_POST
    ... Make your page utf-8, all text on it. ... Set utf-8 encoding and treat all ... incoming data as UTF-8. ... forget to set database and tables to UTF-8, that is default in MySQL 4.1 and ...
    (php.general)