Kev fwm ntawm cov kev pab cuam yog qhov tseem ceeb, tshwj xeeb tshaj yog rau cov neeg siv tsis hais lwm hom lus. Ntau zaus, Delphi cov neeg siv cov kev pab cuam xav paub yuav ua li cas.
Cov Lus Qhia
Kauj ruam 1
Lub ntsiab lus yog tias OEM thiab ANSI encodings (nyob rau hauv uas Delphi ua haujlwm) tsis sib xws. Lawv muaj cov haujlwm sib txawv ntawm Cyrillic cov cim. ANSI tseem muaj cov cim zoo, uas OEM tsis muaj. Tab sis tus thib ob muaj pseudo-nraaj cim, uas yog qhov tseem ceeb rau kev saib cov rooj, txawm hais tias qhov no tsis ntau heev hauv kev thov. Thiab tsis tau tsim nyog sau cia tias, feem ntau, cov ntxhuav no sib pauv hloov tau - lawv muaj peev xwm zoo ib yam rau kev teeb tsa cov ntaub ntawv xov xwm.
Kauj ruam 2
Muaj ob peb txoj hauv kev los daws qhov teeb meem ntawm Kev Tshawb Fawb. Thawj yog ua haujlwm hauv OEM editor. Koj tuaj yeem pib npaj qee yam ntawm cov kev pab cuam cov ntawv nyeem uas yog qhov tseem ceeb rau qhov rooj code hauv ib qho editor uas ua haujlwm nyob rau hauv OEM encoding. Kuj yooj yim, tab sis tib lub sijhawm daws teeb meem zoo. Qhov no yog qhov tseeb tshwj xeeb tshaj yog rau kev sau cov khoom siv hauv zos, nyob rau hauv uas cov zis ntawm cov ntaub ntawv, txawm li ntawd los, yog qhov xav tau.
Kauj ruam 3
Txog rau qhov luv luv ntawm tus qauv no, ntawm no koj tuaj yeem tsim haujlwm ua haujlwm sab nraud IDE, uas paub txog ntau yam, nrog nws lub tswb nrov thiab xuav uas yog qhov zoo hauv lub neej, xws li: coding, sau ua ke, debugging. Thiab tag nrho cov no tau hais, "hauv ib lub raj mis." Ib qho ntxiv, thaum qhov phiaj xwm loj hlob, qee qhov kev nyuaj pib pib pom nws tus kheej thaum tus neeg thib peb cov hlua cov khoom tsim tau siv ANSI encoding pib siv.
Kauj ruam 4
Yog tias qhov project tsis muaj cov hlua ncaj qha tso nrog cov cai (nyuaj-coded), koj tuaj yeem txav tag nrho cov hlua cov khoom siv rau hauv nyias cov qauv, tom qab ntawd ua kom thaj chaw lawv nyob rau qhov chaws uas yuav tsum tau ua. Zoo hmoo, lub network tau tag nrho ntawm cov kev siv uas hloov lub encoding ntawm cov ntaub ntawv.
Kauj ruam 5
Tam sim no hais txog kev siv cov txheej txheem lim dej. Lub Windows API muaj cov haujlwm los pab koj hloov ANSI thiab OEM encodings rau ib leeg. Cov no yog OemToChar thiab CharToOem. Lawv raug siv los tso tawm cov ntawv nyeem nrog kev hloov pauv ntawm cov thooj Writeln ('ntawv nyeem'); rau hauv cov hauv qab no tawg tsam:
cov txheej txheem MyWriteln (const S: string);
var
NewStr: txoj hlua;
pib
SetLengtn (NewStr, Ntev (S));
CharToOem (PChar (S), PChar (NewStr));
Writeln (NewStr);
xaus;
MyWriteln ('ntawv nyeem');
Kauj Ruam 6
Raws li rau qhov tsis zoo ntawm hom qauv no, nws yog qhov tsis yooj yim ntawm kev siv ncua Sau syntax thiab sib txuas cov ntawv thov siv nrog hu rau cov txheej txheem txheej txheem. Thaum koj yuav tsum tau kos daim ntawv thov ua tiav nrog ntau yam hu rau Sau, qhov no dhau los ua teeb meem loj.
Kauj Ruam 7
Kawg, tab sis tsis tsawg, hloov console kab nplooj ntawv siv Windows API. Qhov no yog teev tseg, los ntawm txoj kev. Kev ntes nkaus xwb yog qhov tsis zoo nyob hauv Windows 95 thiab 98. Txawm hais tias yog tias daim ntawv thov yuav khiav ncaj qha rau ntawm Windows NT, qhov no, koj tuaj yeem siv SetConsoleOutputCP kev ua haujlwm (866).