Thaum thauj lub vev xaib nplooj ntawv, qhov browser tau txais ntau cov ntaub ntawv, suav nrog cov ntaub ntawv hais txog nplooj ntawv code uas txiav txim siab cov khoom tsis ua haujlwm ntawm cov lus. Feem ntau, nplooj ntawv code tau tsim thaum tsim lub xaib, tab sis qee zaus nws yuav tsim nyog hloov nws ntawm cov peev txheej uas twb ua haujlwm lawm.
Cov Lus Qhia
Kauj ruam 1
Cov nplooj ntawv code tsim nyog los txhawb cov lus sib txawv, thiab txhua nplooj ntawv suav. Piv txwv li, cov niam ntawv Cyrillic sib raug rau lub encodings Windows 1251, KOI8-R, KOI8-RU, ISO8859-5, DOS 866. Ntawm cov no, thawj zaug tau tshaj tawm hauv Is Taws Nem. Lwm yam lus muaj lawv tus kheej encodings.
Kauj ruam 2
Xav tias muaj ntau ntau yam lus, qhov kev hloov kho qub ntawm qee lub sij hawm pib tsis muaj, lawv tau tig mus los yuav tsis yooj yim heev. Yog li no, xyoo 1991, cov kooshaum non-profit "Unicode Consortium" tau thov qhov kev xaiv ntawv tshiab uas tso cai rau sawv cev ntawm cov tsiaj ntawv ntawm yuav luag txhua cov lus uas twb muaj lawm. Tus lej ntawd npe "Unicode".
Kauj ruam 3
Unicode muaj ntau yam qauv ntawm cov sawv cev, qhov nrov tshaj plaws yog UTF-8. Hauv Is Taws Nem, nws yog nws leej twg maj mam pib hloov lub qub ntawv. Qhov zoo ntawm Unicode yog tias thaum koj nkag mus rau nplooj ntawv, koj yuav tsis pom qhov teeb tsa ntawm qhov tsis tuaj yeem nkag siab es tsis txhob sau cov tsiaj ntawv. Cov cim tau sau nyob rau hauv UTF-8 raug tso tawm kom raug rau hauv lub khoos phis tawj nrog txhua yam lus. Qee zaum cov lus "Unicode" siv sib hloov nrog UTF-16 encoding siv nyob rau hauv Windows interfaces.
Kauj ruam 4
Txij li cov neeg siv ntawm lwm lub teb chaws kuj mus saib cov khoom siv ntawm Lavxias teb sab Internet, hloov cov kev hloov kho tshiab nrog rau qhov tshiab tau dhau los ua txoj haujlwm. Tom qab tag nrho, cov zaub tsis raug ntawm cov ntawv nyeem yuam tus neeg siv tawm ntawm cov peev txheej, uas cuam tshuam tsis zoo rau nws cov koob meej. Txhawm rau hloov lub cim ntawm nplooj ntawv, qhib nws hauv Dreamweaver. Xaiv cov zaub mov "Hloov Kho" - "Nplooj Cov Khoom". Hauv qhov rai uas qhib, xaiv "Npe / Encoding", teeb tsa suab "Unicode (UTF-8)" thiab nyem OK. Tsis muaj dab tsi kos rau ntawm Lub Npe Sau Npe Unicode (BOM). Hloov tag nrho cov nplooj ntawv ntawm lub xaib zoo li no.
Kauj ruam 5
Yog tias koj lub vev xaib nyob rau hauv Apache web server (cov ntaub ntawv no yog nyob rau hauv cov ntaub ntawv xa mus), koj yuav tsum tsim.htaccess cov ntaub ntawv hauv Notepad ++ (nrog rau lub sijhawm thaum pib). Nws tau ua tiav zoo li no: qhib Notepad ++, xaiv "Cov Ntaub Ntawv" - "Tshiab". Ntaus cov kab hauv qab no rau hauv nws: AddDefaultCharset utf-8. Yog tias cov ntaub ntawv no twb muaj lawm, tsuas yog ntxiv cov kab kev cai rau nws.
Kauj Ruam 6
Tam sim no nyem "Encodings" - "Hloov rau UNIX hom". Kaw qhov program, koj yuav kom kev cawm. Paub meej tias txuag, xaiv qhov chaw rau nws. Ntaus lub npe ntawm.htaccess cov ntaub ntawv, tawm ntawm cov hom ntaub ntawv raws li Txhua hom (*. *) Thiab nyem "Txuag". Tam sim no upload cov ntaub ntawv no mus rau lub hauv paus chaw ntawm lub xaib - nyob rau hauv tib qho chaw qhov chaw nplooj ntawv tseem ceeb.
Kauj Ruam 7
Yog tias lub vev xaib siv cov chaw khaws ntaub ntawv, ntxiv cov kab no rau PHP code ntawm cov ntaub ntawv sib txuas ua ntej lub cim npe kaw?>: @Mysql_query ("SET NAMES 'utf8'");
Kauj ruam 8
Txhais cov xaib rau UTF-8 encoding tuaj yeem coj ntau yam teeb meem, yog li ua haujlwm nrog ib daim ntawv theej ntawm lub xaib. Hloov cov nplooj ntawv tseem ceeb nrog hloov kho tsuas yog tom qab koj paub meej txhua yam ua haujlwm. Yog tias tsim nyog, tshawb online rau cov ntaub ntawv pov thawj uas qhia txog koj qhov xwm txheej tshwj xeeb.