Where does the mysqli extension find the default connection charset?

Where does the mysqli extension find the default connection charset?

am 02.05.2007 16:31:35 von elvanor

------=_Part_9660_18346692.1178116295991
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Content-Disposition: inline

SGVsbG8gdGhlcmUsCgpJJ2QgbGlrZSB0byBrbm93IHdoaWNoIGNvbmZpZ3Vy YXRpb24gZmlsZSBv
ciBzZXR0aW5nIGlzIHVzZWQgYnkgUEhQIG15c3FsaQpleHRlbnNpb24gdG8g a25vdyB0aGUgZGVm
YXVsdCBjaGFyc2V0IGNvbm5lY3Rpb24gdG8gdGhlIGRhdGFiYXNlLgoKSSBo YXZlIHR3byBib3hl
cyB3aXRoIE15U1FMIDUgLyBQSFAgNSBvbiB0aGVtLiBPbmUgaXMgYSBHZW50 b28gYm94LCBhbmQg
b24KdGhpcyBvbmUgYnkgZGVmYXVsdCB0aGUgY29ubmVjdGlvbiBoYXBwZW5z IGluIFVURi04LiAg
VGhlIG90aGVyIHNlcnZlciBpcyBhCk1hYyBPUyBYIGJveCBhbmQgaXQgdXNl cyBsYXRpbi0xIGJ5
IGRlZmF1bHQgKGZvcmNpbmcgbWUgdG8gc3dpdGNoIG1hbnVhbGx5KS4KCkkg dGhvdWdodCB0aGUg
aW5mb3JtYXRpb24gd291bGQgYmUgaW4gL2V0Yy9teS5jbmYgKGluIHRoZSBj bGllbnQgY2hhcnNl
dApsaW5lKSwgYnV0IHRoaXMgZmlsZSBpcyBvbiBPUyBYIGFuZCBpdCBkb2Vz IG5vdCB3b3JrLiBU
aGUgb25seSB0aGluZyBJIGNvdWxkCnNlZSB0aGF0IFBIUCBpcyB1c2luZyBp cyBzb21lIGxvY2Fs
ZSBzZXR0aW5ncywgYmVjYXVzZSBvbiBHZW50b28gbG9jYWxlCnByaW50cwoK TEFORz1lbl9VUy5V
VEYtOApMQ19DVFlQRT0iZW5fVVMuVVRGLTgiCkxDX05VTUVSSUM9ImVuX1VT LlVURi04IgpMQ19U
SU1FPSJlbl9VUy5VVEYtOCIKTENfQ09MTEFURT0iZW5fVVMuVVRGLTgiCkxD X01PTkVUQVJZPSJl
bl9VUy5VVEYtOCIKTENfTUVTU0FHRVM9ImVuX1VTLlVURi04IgpMQ19QQVBF Uj0iZW5fVVMuVVRG
LTgiCkxDX05BTUU9ImVuX1VTLlVURi04IgpMQ19BRERSRVNTPSJlbl9VUy5V VEYtOCIKTENfVEVM
RVBIT05FPSJlbl9VUy5VVEYtOCIKTENfTUVBU1VSRU1FTlQ9ImVuX1VTLlVU Ri04IgpMQ19JREVO
VElGSUNBVElPTj0iZW5fVVMuVVRGLTgiCkxDX0FMTD0KCndoZXJlYXMgb24g T1MgWCBsb2NhbGUg
cHJpbnRzOgoKTEFORz0KTENfQ09MTEFURT0iQyIKTENfQ1RZUEU9IkMiCkxD X01FU1NBR0VTPSJD
IgpMQ19NT05FVEFSWT0iQyIKTENfTlVNRVJJQz0iQyIKTENfVElNRT0iQyIK TENfQUxMPSJDIgoK
U28gY291bGQgYW55b25lIGV4cGVyaWVuY2VkIGluIHRoZSBteXNxbGkgZXh0 ZW5zaW9uIGNhbiBo
ZWxwIG1lIHNvIHRoYXQgSQpjYW4gc2V0IHRoZSBkZWZhdWx0IGNoYXJzZXQg Zm9yIHRoZSBjb25u
ZWN0aW9uIHRvIGJlIHV0Zi04IG9uIG15IE9TIFggYm94PwoKVGhhbmtzCgpK ZWFuLU5vw6tsCg==
------=_Part_9660_18346692.1178116295991--

Re: Where does the mysqli extension find the default connectioncharset?

am 02.05.2007 18:50:31 von Georg Richter

Jean-Noël Rivasseau wrote:
> Hello there,
>
> I'd like to know which configuration file or setting is used by PHP mysqli
> extension to know the default charset connection to the database.

mysqli (and also mysql) extension uses the default character set for
libmysql This can be package dependend: Several distros deliver utf8 as
default, others latin1.

To be on the safe side, you should call mysqli_set_charset($link,
"utf8/latin1/whatever) to set the character set for each connection.

/Georg
--
Georg Richter, Development Manager - Connectors & Client Connectivity
MySQL GmbH, Radlkoferstr. 2, D-81373 München, www.mysql.com
Geschäftsführer: Hans von Bell, Kaj Arnö - HRB München 162140

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Where does the mysqli extension find the default connection charset?

am 03.05.2007 09:08:37 von elvanor

------=_Part_25364_16169831.1178176117272
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Content-Disposition: inline

SGVsbG8gYW5kIHRoYW5rcyBmb3IgeW91ciBoZWxwLAoKSG93ZXZlciwgbXkg cXVlc3Rpb24gd2Fz
OiAqaG93KiBpcyBpdCBwYWNrYWdlIGRlcGVuZGVudD8gWW91IHNhaWQgdGhh dCBpdAp1c2VzIGxp
Ym15c3FsLiBJbiB0aGlzIGNhc2UsIHdoaWNoIGZpbGUgY29udHJvbHMgdGhl IGNvbmZpZ3VyYXRp
b24gb2YKbGlibXlzcWw/IE9yIGlzIGl0IGF0IGNvbXBpbGF0aW9uIHRpbWUg dGhhdCB0aGUgY2hv
aWNlIGlzIG1hZGU/CgpJIGtub3cgdGhhdCB0byBiZSBvZiB0aGUgc2FmZSBz aWRlLCBJIHNob3Vs
ZCBleHBsaWNpdGx5IHNldCB0aGUgY2hhcmFjdGVyCnNldC4KCkplYW4tTm9l bAoKCgpPbiA1LzIv
MDcsIEdlb3JnIFJpY2h0ZXIgPGdlb3JnQG15c3FsLmNvbT4gd3JvdGU6Cj4K PiBKZWFuLU5vw6ts
IFJpdmFzc2VhdSB3cm90ZToKPiA+IEhlbGxvIHRoZXJlLAo+ID4KPiA+IEkn ZCBsaWtlIHRvIGtu
b3cgd2hpY2ggY29uZmlndXJhdGlvbiBmaWxlIG9yIHNldHRpbmcgaXMgdXNl ZCBieSBQSFAKPiBt
eXNxbGkKPiA+IGV4dGVuc2lvbiB0byBrbm93IHRoZSBkZWZhdWx0IGNoYXJz ZXQgY29ubmVjdGlv
biB0byB0aGUgZGF0YWJhc2UuCj4KPiBteXNxbGkgKGFuZCBhbHNvIG15c3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