Yuav Ua Li Cas Sau Tus Lej

Cov txheej txheem:

Yuav Ua Li Cas Sau Tus Lej
Yuav Ua Li Cas Sau Tus Lej

Video: Yuav Ua Li Cas Sau Tus Lej

Video: Yuav Ua Li Cas Sau Tus Lej
Video: xov xwm 30/9/2021 raug dag nyiaj ntau kawg vim yuav lej | 2 tug me nyuam tub hmoob poob dej 2024, Hlis ntuj nqeg
Anonim

Txog thaum siv tag nrho cov ntaub ntawv hauv lub network siv tib qho UTF (Unicode Kev Hloov Kho Cov Qauv) cov cwj pwm tau tsim rau txhua lub teb chaws thiab cov neeg, nws yog qhov yuav tsum tau taw qhia qhov encoding siv hauv HTML lossis XML cov ntaub ntawv. Txwv tsis pub, cov nplooj ntawv uas nquag qhia tau hauv koj tus browser tuaj yeem hloov mus rau qhov tsis paub txog "cov neeg tsoo" hauv Is Taws Nem browser ntawm koj cov neeg tuaj saib lub vev xaib.

Yuav ua li cas sau tus lej
Yuav ua li cas sau tus lej

Cov Lus Qhia

Kauj ruam 1

Daim ntawv qhia meta, uas yog qhia tau hais tias lub cim tau siv nyob rau hauv daim ntawv, yuav tsum muab tso rau hauv lub taub hau ze ze rau sab saum toj ntawm nws li sai tau. Nov yog lo lus ntawm W3C (The World Wide Web Consortium), uas tsim kho thiab siv cov qauv thev naus laus zis hauv Is Taws Nem. Daim cim no nws tus kheej hauv cov ntawv HTML yuav zoo li no: Qhov lus qhia no yuav tsum raug siv hauv cov nplooj ntawv sau raws li HTML 4.01 thiab XHTML 1.x tus qauv. Rau ib daim ntawv XHTML, txoj phuam kawg ">" yuav tsum tau hloov nrog "/>". Hauv qhov qauv no, charset = yog ua raws UTF-8 Unicode encoding. Tau kawg, koj yuav tsum hloov UTF-8 nrog koj tus nqi - qhov ib uas cov ntaub ntawv no tau raug cawm, lossis nyob rau hauv uas nws cov ntsiab lus raug muab los ntawm lub hauv paus. Rau cov tsiaj ntawv Lavxias, tshwj tsis yog rau utf-8, cov no tuaj yeem yog qhov tseem ceeb rau qhov rais-1251 (qhov feem ntau), koi8-r, koi8-u, iso-ir-111, iso-8859-5, x-cp866, ibm855, x-mac -cyrillic.

Kauj ruam 2

Txhawm rau teev lub encoding nyob rau hauv lub xaib nplooj ntawv - qhib daim ntawv yuav tsum tau rau kho. Tshawb nrhiav qhov syntax ntawm nplooj ntawv sau sib raug - nws yog qhia thaum pib, hauv kab <! DOCTYPE … Nyob ntawm tus qauv siv (HTML lossis XHTML), npaj lub cim code raws li cov ntaub ntawv saum toj no. Tom qab ntawd pom qhov cim npe hauv nplooj ntawv nplooj - feem ntau cov ntawv encoding yog muab tso rau tom qab nws. Yog tias vim li cas thiaj tsis muaj daim cim npe ntawd hauv kab lis kev cai ntawm koj daim ntawv, tom qab ntawv pom qhov pib uas qhib nqe lus ntawm HTML -. Khaws cov ntawv npaj tom qab nws thiab khaws daim ntawv.

Kauj ruam 3

Yog tias cov nplooj ntawv siv cov ntaub ntawv CSS sab nraud thiab cov ntaub ntawv no muaj cov ntsiab lus uas siv cov cim los ntawm cov ntawv sau hauv lub tebchaws, tom qab ntawd lawv yuav tsum qhia qhov cim tau siv. Hauv thawj kab ntawm cov ntaub ntawv style, ntxiv: @charset "windows-1251"; hloov lub qhov rais-1251 nrog tus nqi koj xav tau. Ntxiv rau, koj tuaj yeem qhia qhov encoding uas browser yuav tsum siv thaum nyem rau ntawm qhov txuas. Txhawm rau ua qhov no, muab cov cim cwj pwm nrog cov xav kom raug tus nqi hauv kab ntawv txuas. Piv txwv li: Yooj Yim!

Pom zoo: