List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:June 8 1999 12:21am
Subject:problem with encode
View as plain text  
>>>>> "Nathan" == Nathan Feger <nathan@stripped> writes:

Nathan> hi,
Nathan> I seem to be having a problem working with the encode function.

Nathan> here is the output for what I have done:
mysql> select encode("you there","jim");
Nathan> +---------------------------+
Nathan> | encode("you there","jim") |
Nathan> +---------------------------+
Nathan> | ]µý
Nathan> +---------------------------+
Nathan> 1 row in set (0.01 sec)

Note that above row is not complete!  (There is no end |).

As encode may return any ASCII character, this means that you may not
see all characters produced by encode() in the mysql prompt.

mysql> select decode("]µý","jim");
Nathan> +---------------------+
Nathan> | decode("]µý","jim") |
Nathan> +---------------------+
Nathan> | you                 |
Nathan> +---------------------+
Nathan> 1 row in set (0.00 sec)

See above.


Nathan> Am I working this function wrong?  Shouldn't I be getting a '|' at on
Nathan> that last line of the "select encode..."

Yes, but this may not be visible if there is some control characters
in the output.

Nathan> btw,
Nathan> I'm running mysql  Ver 9.26 Distrib 3.22.10-beta, for pc-linux-gnu
Nathan> (i686)

Nathan> on redhat linux.  And the crypt library is installed.

Try:

select length(encode("you there","jim"));

Regards,
Monty
Thread
problem with encodeNathan Feger8 Jun
  • problem with encodeMichael Widenius8 Jun