Re: MySQL Escaped String
Re: MySQL Escaped String
- Subject: Re: MySQL Escaped String
- From: Will Mason <email@hidden>
- Date: Tue, 11 Jan 2005 23:25:51 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
If mysql_escape_string() takes something that should be considered text
and doesn't bother to tell you what encoding it wants, then that's a
bug. You should tell them. Even if the encoding is "Unicode", which is
supposed to be universal, and they don't tell you which variety they
want (UTF-8, UTF-16BE, UTF-16LE, etc...), then they are leaving you in
the dark. There may be a way to guess what they want, but you're still
only guessing. It's likely that they expect the "default" encoding for
the machine, but even this is open to interpretation. Cocoa determines
the default encoding one way, ICU another, and so forth. There is no
canonical default encoding. If you don't believe me, then take a look
at the ICU source code (open source at http://www-124.ibm.com/icu/) for
determining the default encoding. It's very complex and very unlikely
to be the same for everyone attempting to determine the default
encoding.
Good luck,
Will
--- Robin Hermann <email@hidden> wrote:
> From the MySQL reference
>
> /*-----
> This function is identical to mysql_real_escape_string() except that
> mysql_real_escape_string() takes a connection handler as its first
> argument and escapes the string according to the current character
> set.
> mysql_escape_string() does not take a connection argument and does
> not
> respect the current charset setting.
> -----*/
>
> I can't find any info which encoding is needed for
> mysql_escape_string.
> The standard encoding on the server is ISO-8859-1 (Latin1). Right now
>
> figuring out how to get the connection handler from SMySQLConnection,
>
> or implement my own to start using the mysql_real_escape_string.
> Which
> seems to be the only right way to do it.
>
> Robin Hermann
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden