List:Internals« Previous MessageNext Message »
From:Hagen Höpfner Date:June 10 2005 1:55pm
Subject:Re: Text Encoding
View as plain text  
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok, the next question ;-)

If I have a table with an utf8 coded char(1) attribute and insert the
value "a" this is stored as 0x61 20 20. The output of "SHOW CHARACTER
TYPES" mentioned a maximal length. However, it seems, that this maximal
length is used even if one byte (like here) would be enough? I think,
this is based on the idea of handling possible updates (e.g.. a->?) more
efficient, but why do you call the character length to be maximal if it
is used all the time?

Hagen

Sergei Golubchik wrote:
> Hi!
> 
> On Jun 09, Hagen H?pfner wrote:
> 
>>Dear list,
>>
>>i currently try to understand some MySQL internas. However, I am 
>>wondering about the text encoding. I created a table while using latin1 
>>and another while using utf8 on a windoof-machine. Then I inserted the 
>>value "abäöüß" that includes special German characters. If I
> now look 
>>into the MYD-file with a hex-editor, both tables include the same Bytes. 
>>Does MySQL internally use a default encoding? If so, which one is used 
>>internally. While looking at a standard ASCII-table one can recognize, 
>>that "a" and "b" is standard latin1 (61 and 62) but "äöüß"
> ist something 
>>else.
> 
> 
> No, MySQL does not use default encoding internally.
> Check table definitions with 'SHOW CREATE TABLE'.
>  
> Regards,
> Sergei
> 


- --
- ------------------------------------------------------------
Dr.-Ing. Hagen Höpfner | hoepfner@stripped | +49 7251 700 239
- ------------------------------------------------------------
         http://www.i-u.de/schools/hopfner/index.html

             International University in Germany
               School of Information Technology
                  Campus 3  D-76646 Bruchsal
- ------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: GnuPT 2.6.0 by EQUIPMENTE.DE
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCqZvCataeEpWdQtYRArghAJ4scwblQhuC5neSXTf0p2sJY2EAkACeKbyt
8ExyYOfEoY3sJqpI0Mv2FxA=
=yLzY
-----END PGP SIGNATURE-----
Thread
Text EncodingHagen Höpfner9 Jun
  • Re: Text EncodingSergei Golubchik10 Jun
    • Re: Text EncodingHagen Höpfner10 Jun
      • Re: Text EncodingSergei Golubchik10 Jun
        • Re: Text EncodingHagen Höpfner10 Jun
          • Re: Text EncodingSergei Golubchik10 Jun
            • Re: Text EncodingOlaf van der Spek10 Jun
              • Re: Text EncodingSergei Golubchik11 Jun