andrisp Posted January 24, 2006 Report Posted January 24, 2006 Bija viena datubāzīte 4.0 serverī ar kodējumu cp1257, izeksportēju to text/sql failā vēl aizvien cp1257 kodējumā. Ir cits serveris (4.1), kur default character set ir utf-8. Tur izveidoju databāzi un uzstādīju charsetu uz cp1257. Ar šādu rindu: ALTER DATABASE `db` DEFAULT CHARACTER SET 'cp1257'; Pēc tam mēģinu importēt iepriekš exportēto text/sql failu, bet visi latviešu simboli pārkonvertējās par utf-8. Kur ir problēma ?
Roze Posted January 24, 2006 Report Posted January 24, 2006 Caur ko taisi importu? Ja caur 'mysql' pamēģini pielikt mysql --default-character-set=cp1257 ... < tavs.sql
andrisp Posted January 24, 2006 Author Report Posted January 24, 2006 caur phpmyadmin, tur pat noraadiiju, ka source fails ir cp1257.. pameegjinaashu no mysql tuulja
[Ya] Posted January 24, 2006 Report Posted January 24, 2006 a tad kad tu skaties phpmyadminā tev skata charsets ir utf8 vai cp1257?
andrisp Posted January 24, 2006 Author Report Posted January 24, 2006 Browserim uzsleedzu cp1257, bet vispaar shis (phpmyadmin) saka utf-8, bet cp1257, tur nemaz nevar izveeleeties.. Pameegjinaaju izdzeest visu datubaazi aaraa, peec tam izveidot jaunu ar komandu CREATE DATABASE `db` DEFAUL CHARACTER SET cp1257 - viss ok. Tālāk caur to pashu phpmyadmin pameegjinaaju to sql kodu izpildiit (neizmantojot import, bet caur browsera textarea), browserism uzsleedzu cp1257. Rezultaataa visi lv simboli tiek paarveersi par ? un pat vairs par utf-8 ne ..
Grey_Wolf Posted January 24, 2006 Report Posted January 24, 2006 Ja tabulas nav daudz tad palabo pashu dump failu.. pieliec tabulas izveidei DEFAULT CHARSET=.... ------- CREATE TABLE `aaaaaaaaaaa` ( `a` char(3) NOT NULL default '', `b` varchar(5) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=cp1257; --------
andrisp Posted January 24, 2006 Author Report Posted January 24, 2006 CREATE TABLE `asdasd` ( `ts` TEXT NOT NULL ) TYPE = MYISAM CHARACTER SET cp1257 COLLATE cp1257_general_ci; Un vienalga nevar ieglabaat latvieshu simbolus ! :(((
andrisp Posted January 24, 2006 Author Report Posted January 24, 2006 nu es laikam sajaucu ar "Language:", kur var izveeleeties tikai starp utf, tu laikam domaaji "MySQL connection collation:", izveeleejos cp1257, bet taapat visi latvieshu simboli paartop par "?"
Recommended Posts