ckuxla.c 270 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589
  1. #include "ckcsym.h"
  2. #include "ckcdeb.h" /* Includes... */
  3. #include "ckcker.h"
  4. #include "ckucmd.h"
  5. #include "ckcxla.h"
  6. #ifdef NOXFER
  7. #define zdstuff(a)
  8. #endif /* NOXFER */
  9. #ifndef NOCSETS
  10. char *xlav = "Character Set Translation 9.0.044, 2 Jun 2011";
  11. /* C K U X L A */
  12. /* C-Kermit tables and functions supporting character set translation. */
  13. /*
  14. Author: Frank da Cruz <fdc@columbia.edu>,
  15. Columbia University Academic Information Systems, New York City.
  16. Copyright (C) 1985, 2011,
  17. Trustees of Columbia University in the City of New York.
  18. All rights reserved. See the C-Kermit COPYING.TXT file or the
  19. copyright text in the ckcmai.c module for disclaimer and permissions.
  20. */
  21. /* Character set translation data and functions */
  22. extern int zincnt; /* File i/o macros and variables */
  23. extern char *zinptr;
  24. extern int zoutcnt;
  25. extern char *zoutptr;
  26. extern int byteorder;
  27. extern int xfrxla;
  28. int tslevel = TS_L0; /* Transfer syntax level (0,1,2) */
  29. int tcharset = TC_TRANSP; /* Transfer syntax character set */
  30. int tcs_save = -1; /* For save/restore term charset */
  31. int tcs_transp = 0; /* Term charset is TRANSPARENT flag */
  32. #ifdef CKOUNI
  33. int tcsr = TX_8859_1; /* Remote terminal character set */
  34. #else /* CKOUNI */
  35. int tcsr = FC_USASCII;
  36. #endif /* CKOUNI */
  37. int language = L_USASCII; /* Language */
  38. #ifdef UNICODE
  39. int ucsbom = 1; /* Add BOM to new UCS files? */
  40. int ucsorder = -1; /* Default byte order for UCS files */
  41. int fileorder = -1; /* Byte order of current file */
  42. /* 0 = BE, 1 = LE */
  43. #endif /* UNICODE */
  44. /*
  45. Default local file and terminal character set.
  46. Normally ASCII, but for some systems we know otherwise.
  47. */
  48. int fcs_save = -1;
  49. #ifdef datageneral /* Data General AOS/VS */
  50. int fcharset = FC_DGMCS; /* uses the DG International set */
  51. int dcset8 = FC_DGMCS;
  52. int dcset7 = FC_USASCII;
  53. int tcsl = FC_DGMCS;
  54. #else
  55. #ifdef NEXT /* The NeXT workstation */
  56. int fcharset = FC_NEXT; /* uses its own 8-bit set */
  57. int dcset8 = FC_NEXT;
  58. int dcset7 = FC_USASCII;
  59. int tcsl = FC_NEXT;
  60. #else
  61. #ifdef MAC /* The Macintosh */
  62. int fcharset = FC_APPQD; /* uses an extended version of */
  63. int dcset8 = FC_APPQD;
  64. int dcset7 = FC_USASCII;
  65. int tcsl = FC_APPQD; /* Apple Quickdraw */
  66. #else
  67. #ifdef AUX
  68. int fcharset = FC_APPQD; /* Ditto for Apple A/UX */
  69. int dcset8 = FC_APPQD;
  70. int dcset7 = FC_USASCII;
  71. int tcsl = FC_APPQD;
  72. #else
  73. #ifdef AMIGA /* The Commodore Amiga */
  74. int fcharset = FC_1LATIN; /* uses Latin-1 */
  75. int dcset8 = FC_1LATIN;
  76. int dcset7 = FC_USASCII;
  77. int tcsl = FC_1LATIN;
  78. #else /* All others */
  79. #ifdef CKOUNI /* OS/2 Unicode */
  80. int fcharset = FC_1LATIN;
  81. int dcset8 = FC_1LATIN;
  82. int dcset7 = FC_USASCII;
  83. int tcsl = TX_8859_1;
  84. int prncs = TX_CP437;
  85. #else /* All others */
  86. int fcharset = FC_USASCII; /* use ASCII by default */
  87. int dcset8 = FC_1LATIN; /* But default 8-bit set is Latin-1 */
  88. int dcset7 = FC_USASCII;
  89. int tcsl = FC_USASCII;
  90. int prncs = FC_CP437;
  91. #endif /* CKOUNI */
  92. #endif /* AMIGA */
  93. #endif /* AUX */
  94. #endif /* MAC */
  95. #endif /* NEXT */
  96. #endif /* datageneral */
  97. int s_cset = XMODE_A; /* SEND charset selection = AUTO */
  98. int r_cset = XMODE_A; /* RECV charset selection = AUTO */
  99. int afcset[MAXFCSETS+1]; /* Character-set associations */
  100. int axcset[MAXTCSETS+1];
  101. int xlatype = XLA_NONE; /* Translation type */
  102. #ifdef UNICODE
  103. #ifdef CK_ANSIC
  104. extern int (*xl_utc[MAXTCSETS+1])(USHORT); /* Unicode to TCS */
  105. extern int (*xl_ufc[MAXFCSETS+1])(USHORT); /* Unicode to FCS */
  106. extern USHORT (*xl_tcu[MAXTCSETS+1])(CHAR); /* TCS to Unicode */
  107. extern USHORT (*xl_fcu[MAXFCSETS+1])(CHAR); /* FCS to Unicode */
  108. #else
  109. extern int (*xl_utc[MAXTCSETS+1])();
  110. extern int (*xl_ufc[MAXFCSETS+1])();
  111. extern USHORT (*xl_tcu[MAXTCSETS+1])();
  112. extern USHORT (*xl_fcu[MAXFCSETS+1])();
  113. #endif /* CK_ANSIC */
  114. #endif /* UNICODE */
  115. /* Bureaucracy section */
  116. _PROTOTYP( CHAR xnel1, (CHAR c) ); /* NeXT to Latin-1 */
  117. _PROTOTYP( CHAR xl143, (CHAR c) ); /* Latin-1 to IBM CP437 */
  118. _PROTOTYP( CHAR xl1as, (CHAR c) ); /* Latin-1 to US ASCII */
  119. _PROTOTYP( CHAR zl1as, (CHAR c) ); /* Latin-1 to US ASCII */
  120. #ifdef CYRILLIC
  121. _PROTOTYP( CHAR xassk, (CHAR c) ); /* ASCII to Short KOI */
  122. _PROTOTYP( CHAR xskcy, (CHAR c) ); /* Short KOI to Latin/Cyrillic */
  123. #endif /* CYRILLIC */
  124. #ifdef LATIN2
  125. _PROTOTYP( CHAR xnel2, (CHAR c) ); /* NeXT to Latin-2 */
  126. _PROTOTYP( CHAR xl243, (CHAR c) ); /* Latin-2 to IBM CP437 */
  127. _PROTOTYP( CHAR xl2as, (CHAR c) ); /* Latin-2 to US ASCII */
  128. _PROTOTYP( CHAR zl2as, (CHAR c) ); /* Latin-2 to US ASCII */
  129. _PROTOTYP( CHAR xl2r8, (CHAR c) ); /* Latin-2 to HP */
  130. _PROTOTYP( CHAR xl2l9, (CHAR c) ); /* Latin-2 to Latin-9 */
  131. _PROTOTYP( CHAR xl9l2, (CHAR c) ); /* Latin-9 to Latin-2 */
  132. _PROTOTYP( CHAR xl2mz, (CHAR c) ); /* Latin-2 to Mazovia */
  133. _PROTOTYP( CHAR xmzl2, (CHAR c) ); /* Mazovia to Latin-2 */
  134. _PROTOTYP( CHAR xl1mz, (CHAR c) ); /* Latin-1 to Mazovia */
  135. _PROTOTYP( CHAR xmzl1, (CHAR c) ); /* Mazovia to Latin-1 */
  136. _PROTOTYP( CHAR xmzl9, (CHAR c) ); /* Latin-9 to Mazovia */
  137. _PROTOTYP( CHAR xl9mz, (CHAR c) ); /* Mazovia to Latin-9 */
  138. #endif /* LATIN2 */
  139. /* Transfer character-set info */
  140. struct csinfo tcsinfo[] = {
  141. /* Name size code designator alphabet keyword */
  142. "TRANSPARENT", 256,TC_TRANSP, "", AL_UNK, "transparent", /* 0 */
  143. "ASCII", 128,TC_USASCII,"", AL_ROMAN,"ascii", /* 1 */
  144. "ISO 8859-1 Latin-1",256,TC_1LATIN, "I6/100",AL_ROMAN,"latin1-iso", /* 2 */
  145. #ifdef LATIN2
  146. "ISO 8859-2 Latin-2",256,TC_2LATIN, "I6/101",AL_ROMAN,"latin2-iso", /* 3 */
  147. #endif /* LATIN2 */
  148. #ifdef CYRILLIC
  149. /* 4 */
  150. "ISO 8859-5 Latin/Cyrillic",256,TC_CYRILL,"I6/144",AL_CYRIL,"cyrillic-iso",
  151. #endif /* CYRILLIC */
  152. #ifdef KANJI
  153. "Japanese EUC",16384,TC_JEUC, "I14/87/13", AL_JAPAN, "euc-jp", /* 5 */
  154. #endif /* KANJI */
  155. #ifdef HEBREW
  156. /* 6 */
  157. "ISO 8859-8 Latin/Hebrew",256,TC_HEBREW,"I6/138",AL_HEBREW,"hebrew-iso",
  158. #endif /* HEBREW */
  159. #ifdef GREEK
  160. "ISO 8859-7 Latin/Greek",256,TC_GREEK,"I6/126",AL_GREEK,"greek-iso", /* 7 */
  161. #endif /* GREEK */
  162. "ISO 8859-15 Latin-9",256,TC_9LATIN,"I6/203",AL_ROMAN,"latin9-iso", /* 8 */
  163. "ISO 10646 / Unicode UCS-2",64000,TC_UCS2,"I162",AL_UNIV,"ucs2", /* 9 */
  164. "ISO 10646 / Unicode UTF-8",64000,TC_UTF8,"I190",AL_UNIV,"utf8", /* 10 */
  165. "",0,0,"",0,""
  166. };
  167. int ntcsets = (sizeof(tcsinfo) / sizeof(struct csinfo)) - 1;
  168. struct keytab tcstab[] = { /* Keyword table for */
  169. "ascii", TC_USASCII, 0, /* SET TRANSFER CHARACTER-SET */
  170. #ifdef CYRILLIC
  171. "cyrillic-iso", TC_CYRILL, 0,
  172. #endif /* CYRILLIC */
  173. #ifdef GREEK
  174. "elot928-greek", TC_GREEK, CM_INV,
  175. #endif /* GREEK */
  176. #ifdef KANJI
  177. "euc-jp", TC_JEUC, 0,
  178. #endif /* KANJI */
  179. #ifdef GREEK
  180. "greek-iso", TC_GREEK, 0,
  181. #endif /* GREEK */
  182. #ifdef HEBREW
  183. "hebrew-iso", TC_HEBREW, 0,
  184. #endif /* HEBREW */
  185. #ifdef UNICODE
  186. "iso-10646-ucs-2", TC_UCS2, CM_INV, /* ISO 10646 / Unicode UCS-2 */
  187. #endif /* UNICODE */
  188. "iso-8859-1", TC_1LATIN, CM_INV, /* ISO Latin Alphabet 1 */
  189. "iso-8859-15", TC_9LATIN, CM_INV, /* ISO Latin Alphabet 9 (yes) */
  190. "iso-8859-2", TC_2LATIN, CM_INV, /* ISO Latin Alphabet 2 */
  191. #ifdef CYRILLIC
  192. "iso-8859-5", TC_CYRILL, CM_INV, /* ISO Latin/Cyrillic Alphabet */
  193. #endif /* CYRILLIC */
  194. #ifdef GREEK
  195. "iso-8859-7", TC_GREEK, CM_INV, /* ISO 8859-7 Latin/Greek */
  196. #endif /* GREEK */
  197. #ifdef HEBREW
  198. "iso-8859-8", TC_HEBREW, CM_INV, /* ISO Latin/Hebrew */
  199. #endif /* HEBREW */
  200. #ifdef KANJI
  201. "japanese-euc", TC_JEUC, CM_INV,
  202. #endif /* KANJI */
  203. "l", TC_1LATIN, CM_ABR|CM_INV,
  204. "la", TC_1LATIN, CM_ABR|CM_INV,
  205. "lat", TC_1LATIN, CM_ABR|CM_INV,
  206. "lati", TC_1LATIN, CM_ABR|CM_INV,
  207. "latin", TC_1LATIN, CM_ABR|CM_INV,
  208. "latin1-iso", TC_1LATIN, 0,
  209. #ifdef LATIN2
  210. "latin2-iso", TC_2LATIN, 0,
  211. #endif /* LATIN2 */
  212. "latin9-iso", TC_9LATIN, 0,
  213. "transparent", TC_TRANSP, 0,
  214. #ifdef UNICODE
  215. "ucs2", TC_UCS2, 0,
  216. #endif /* UNICODE */
  217. "us-ascii", TC_USASCII, CM_INV,
  218. "usascii", TC_USASCII, CM_INV,
  219. #ifdef UNICODE
  220. "utf-8", TC_UTF8, CM_INV,
  221. "utf8", TC_UTF8, 0,
  222. #endif /* UNICODE */
  223. "", 0, 0
  224. };
  225. int ntcs = (sizeof(tcstab) / sizeof(struct keytab)) - 1;
  226. /* File character set information structure, indexed by character set code, */
  227. /* as defined in ckuxla.h. This table must be in order of file character */
  228. /* set number! */
  229. struct csinfo fcsinfo[] = { /* File character set information... */
  230. /* Descriptive Name Size Designator */
  231. "US ASCII", 128, FC_USASCII, NULL, AL_ROMAN, "ascii",
  232. "British/UK ISO-646", 128, FC_UKASCII, NULL, AL_ROMAN, "british",
  233. "Dutch ISO-646", 128, FC_DUASCII, NULL, AL_ROMAN, "dutch",
  234. "Finnish ISO-646", 128, FC_FIASCII, NULL, AL_ROMAN, "finnish",
  235. "French ISO-646", 128, FC_FRASCII, NULL, AL_ROMAN, "french",
  236. "Canadian-French NRC", 128, FC_FCASCII, NULL, AL_ROMAN, "canadian-french",
  237. "German ISO-646", 128, FC_GEASCII, NULL, AL_ROMAN, "german",
  238. "Hungarian ISO-646", 128, FC_HUASCII, NULL, AL_ROMAN, "hungarian",
  239. "Italian ISO-646", 128, FC_ITASCII, NULL, AL_ROMAN, "italian",
  240. "Norwegian/Danish ISO-646",128,FC_NOASCII,NULL,AL_ROMAN,"norwegian/danish",
  241. "Portuguese ISO-646", 128, FC_POASCII, NULL, AL_ROMAN,"portuguese",
  242. "Spanish ISO-646", 128, FC_SPASCII, NULL, AL_ROMAN, "spanish",
  243. "Swedish ISO-646", 128, FC_SWASCII, NULL, AL_ROMAN, "swedish",
  244. "Swiss NRC", 128, FC_CHASCII, NULL, AL_ROMAN, "swiss",
  245. "ISO 8859-1 Latin-1", 256, FC_1LATIN, NULL, AL_ROMAN,"latin1-iso",
  246. "ISO 8859-2 Latin-2", 256, FC_2LATIN, NULL, AL_ROMAN,"latin2-iso",
  247. "DEC Multinational", 256, FC_DECMCS, NULL,AL_ROMAN,"dec-multinational",
  248. "NeXT Multinational", 256, FC_NEXT, NULL,AL_ROMAN,"next-multinational",
  249. "PC Code Page 437", 256, FC_CP437, NULL, AL_ROMAN,"cp437",
  250. "PC Code Page 850", 256, FC_CP850, NULL, AL_ROMAN,"cp850",
  251. "PC Code Page 852", 256, FC_CP852, NULL, AL_ROMAN,"cp852",
  252. "Apple Macintosh Latin", 256, FC_APPQD, NULL, AL_ROMAN,"macintosh-latin",
  253. "Data General International",256,FC_DGMCS,NULL,AL_ROMAN,"dg-international",
  254. "Hewlett Packard Roman8", 256, FC_HPR8, NULL, AL_ROMAN, "hp-roman8",
  255. "ISO 8859-5 Latin/Cyrillic", 256, FC_CYRILL, NULL, AL_CYRIL,"cyrillic-iso",
  256. "CP866 Cyrillic", 256, FC_CP866, NULL, AL_CYRIL,"cp866",
  257. "Short KOI", 128, FC_KOI7, NULL, AL_CYRIL,"short-koi",
  258. "Old KOI-8 Cyrillic", 256, FC_KOI8, NULL, AL_CYRIL,"koi8-cyrillic",
  259. "Japanese JIS7", 16384, FC_JIS7, NULL, AL_JAPAN, "jis7-kanji",
  260. "Japanese Shift JIS", 16384, FC_SHJIS, NULL, AL_JAPAN, "shift-jis-kanji",
  261. "Japanese EUC", 16384, FC_JEUC, NULL, AL_JAPAN, "euc-jp",
  262. "Japanese DEC Kanji", 16384, FC_JDEC, NULL, AL_JAPAN, "dec-kanji",
  263. "Hebrew-7 DEC", 128, FC_HE7, NULL, AL_HEBREW, "hebrew-7",
  264. "ISO 8859-8 Latin/Hebrew",256, FC_HEBREW, NULL, AL_HEBREW, "hebrew-iso",
  265. "CP862 Hebrew", 256, FC_CP862, NULL, AL_HEBREW, "cp862-hebrew",
  266. "ELOT 927 Greek", 128, FC_ELOT, NULL, AL_GREEK, "elot927-greek",
  267. "ISO 8859-7 Latin/Greek", 256, FC_GREEK, NULL, AL_GREEK, "greek-iso",
  268. "CP869 Greek", 256, FC_CP869, NULL, AL_GREEK, "cp869-greek",
  269. "ISO 8859-15 Latin-9", 256, FC_9LATIN, NULL, AL_ROMAN, "latin9-iso",
  270. "PC Code Page 858", 256, FC_CP850, NULL, AL_ROMAN, "cp858",
  271. "PC Code Page 855", 256, FC_CP855, NULL, AL_CYRIL, "cp855-cyrillic",
  272. "Windows Code Page 1251", 256, FC_CP1251, NULL, AL_CYRIL, "cp1251-cyrillic",
  273. "Bulgarian PC Code Page", 256, FC_BULGAR, NULL, AL_CYRIL, "bulgaria-pc",
  274. "Windows Code Page 1250", 256, FC_CP1250, NULL, AL_ROMAN, "cp1250",
  275. "Polish Mazovia PC Code Page", 256, FC_MAZOVIA, NULL, AL_ROMAN, "mazovia-pc",
  276. "ISO 10646 / Unicode UCS-2", 64000, FC_UCS2, NULL, AL_UNIV, "ucs2",
  277. "ISO 10646 / Unicode UTF-8", 64000, FC_UCS2, NULL, AL_UNIV, "utf8",
  278. "KOI8-R Russian+Boxdrawing",256, FC_KOI8R, NULL, AL_CYRIL,"koi8r",
  279. "KOI8-U Ukrainian+Boxdrawing",256,FC_KOI8U, NULL, AL_CYRIL,"koi8u",
  280. "Windows Code Page 1252", 256, FC_CP1252, NULL, AL_ROMAN, "cp1252",
  281. "",0,0,NULL,0,NULL
  282. };
  283. /* Local file character sets */
  284. /* Includes 7-bit National Replacement Character Sets of ISO 646 */
  285. /* Plus ISO Latin-1, DEC Multinational Character Set (MCS), NeXT char set, */
  286. /* Various PC and Windows code pages, etc. */
  287. /* As of C-Kermit 9.0 MIME names are included as invisible synomyms for */
  288. /* those character sets that have MIME names. */
  289. struct keytab fcstab[] = { /* Keyword table for 'set file character-set' */
  290. /*
  291. IMPORTANT: This table is replicated below as ttcstab (terminal character
  292. set table). The only differences are the addition of TRANSPARENT
  293. and the removal of the Kanji sets, which are not supported for terminal
  294. emulation. If you make changes to this table, also change ttcstab.
  295. */
  296. /* Keyword Value Flags */
  297. "apple-quickdraw", FC_APPQD, CM_INV, /* Apple Quickdraw */
  298. "ascii", FC_USASCII, 0, /* ASCII */
  299. "british", FC_UKASCII, 0, /* British NRC */
  300. "bulgaria-pc", FC_BULGAR, 0, /* Bulgarian PC Code Page */
  301. "canadian-french", FC_FCASCII, 0, /* French Canadian NRC */
  302. #ifdef LATIN2
  303. "cp1250", FC_CP1250, 0, /* Windows CP 1250 */
  304. #endif /* LATIN2 */
  305. #ifdef CYRILLIC
  306. "cp1251-cyrillic", FC_CP1251, 0, /* Windows CP 1251 */
  307. #endif /* CYRILLIC */
  308. "cp1252", FC_CP1252, 0, /* Windows CP 1252 */
  309. "cp437", FC_CP437, 0, /* PC CP437 */
  310. "cp850", FC_CP850, 0, /* PC CP850 */
  311. #ifdef LATIN2
  312. "cp852", FC_CP852, 0, /* PC CP852 */
  313. #endif /* LATIN2 */
  314. #ifdef CYRILLIC
  315. "cp855-cyrillic", FC_CP855, 0, /* PC CP855 */
  316. #endif /* CYRILLIC */
  317. "cp858", FC_CP858, 0, /* PC CP858 */
  318. #ifdef HEBREW
  319. "cp862-hebrew", FC_CP862, 0, /* PC CP862 */
  320. #endif /* HEBREW */
  321. #ifdef CYRILLIC
  322. "cp866-cyrillic", FC_CP866, 0, /* CP866 Cyrillic */
  323. #endif /* CYRILLIC */
  324. #ifdef GREEK
  325. "cp869-greek", FC_CP869, 0, /* CP869 Greek */
  326. #endif /* GREEK */
  327. #ifdef CYRILLIC
  328. "cyrillic-iso", FC_CYRILL, 0, /* ISO Latin/Cyrillic Alphabet */
  329. #endif /* CYRILLIC */
  330. "danish", FC_NOASCII, 0, /* Norwegian and Danish NRC */
  331. #ifdef KANJI
  332. "dec-kanji", FC_JDEC, 0, /* Japanese DEC Kanji */
  333. #endif /* KANJI */
  334. "dec-mcs", FC_DECMCS, CM_INV, /* DEC multinational char set */
  335. "dec-multinational", FC_DECMCS, 0, /* DEC multinational character set */
  336. "dg-international", FC_DGMCS, 0, /* Data General multinational */
  337. "dutch", FC_DUASCII, 0, /* Dutch NRC */
  338. #ifdef GREEK
  339. "elot927-greek", FC_ELOT, 0, /* ELOT 927 Greek */
  340. "elot928-greek", FC_GREEK, 0, /* Same as ISO 8859-7 Latin/Greek */
  341. #endif /* GREEK */
  342. #ifdef KANJI
  343. "euc-jp", FC_JEUC, 0, /* Japanese EUC */
  344. #endif /* KANJI */
  345. "finnish", FC_FIASCII, 0, /* Finnish NRC */
  346. "french", FC_FRASCII, 0, /* French NRC */
  347. "fr-canadian", FC_FCASCII, CM_INV, /* French Canadian NRC */
  348. "german", FC_GEASCII, 0, /* German NRC */
  349. #ifdef GREEK
  350. "greek-iso", FC_GREEK, 0, /* ISO 8859-7 Latin/Greek */
  351. #endif /* GREEK */
  352. #ifdef HEBREW
  353. "he", FC_HEBREW, CM_ABR|CM_INV,
  354. "heb", FC_HEBREW, CM_ABR|CM_INV,
  355. "hebr", FC_HEBREW, CM_ABR|CM_INV,
  356. "hebre", FC_HEBREW, CM_ABR|CM_INV,
  357. "hebrew", FC_HEBREW, CM_ABR|CM_INV,
  358. "hebrew-7", FC_HE7, 0, /* DEC 7-Bit Hebrew */
  359. "hebrew-iso", FC_HEBREW, 0, /* ISO Latin/Hebrew */
  360. #endif /* HEBREW */
  361. "hp-roman8", FC_HPR8, 0, /* Hewlett Packard Roman8 */
  362. "hungarian", FC_HUASCII, 0, /* Hungarian NRC */
  363. "ibm437", FC_CP437, CM_INV, /* PC CP437 */
  364. "ibm850", FC_CP850, CM_INV, /* PC CP850 (not in MIME) */
  365. #ifdef LATIN2
  366. "ibm852", FC_CP852, CM_INV, /* PC CP852 */
  367. #endif /* LATIN2 */
  368. #ifdef CYRILLIC
  369. "ibm855", FC_CP855, CM_INV, /* PC CP855 */
  370. #endif /* CYRILLIC */
  371. "ibm858", FC_CP858, CM_INV, /* PC CP858 (not in MIME) */
  372. #ifdef HEBREW
  373. "ibm862", FC_CP862, CM_INV, /* PC CP862 (not in MIME) */
  374. #endif /* HEBREW */
  375. #ifdef CYRILLIC
  376. "ibm866", FC_CP866, CM_INV, /* CP866 Cyrillic */
  377. #endif /* CYRILLIC */
  378. #ifdef GREEK
  379. "ibm869", FC_CP869, CM_INV, /* CP869 Greek */
  380. #endif /* GREEK */
  381. #ifdef UNICODE
  382. "iso-10646-ucs-2", FC_UCS2, CM_INV, /* ISO 10646 / Unicode UCS-2 */
  383. #endif /* UNICODE */
  384. "iso-8859-1", FC_1LATIN, CM_INV, /* ISO Latin Alphabet 1 */
  385. "iso-8859-15", FC_9LATIN, CM_INV, /* ISO Latin Alphabet 9 (yes) */
  386. "iso-8859-2", FC_2LATIN, CM_INV, /* ISO Latin Alphabet 2 */
  387. #ifdef CYRILLIC
  388. "iso-8859-5", FC_CYRILL, CM_INV, /* ISO Latin/Cyrillic Alphabet */
  389. #endif /* CYRILLIC */
  390. #ifdef GREEK
  391. "iso-8859-7", FC_GREEK, CM_INV, /* ISO 8859-7 Latin/Greek */
  392. #endif /* GREEK */
  393. #ifdef HEBREW
  394. "iso-8859-8", FC_HEBREW, CM_INV, /* ISO Latin/Hebrew */
  395. #endif /* HEBREW */
  396. #ifdef KANJI
  397. "iso2022jp-kanji", FC_JIS7, CM_INV, /* Synonym for JIS-7 */
  398. #endif /* KANJI */
  399. "iso646-gb", FC_UKASCII, CM_INV, /* British NRC */
  400. "iso646-ca", FC_FCASCII, CM_INV, /* French Canadian NRC */
  401. "iso646-de", FC_GEASCII, CM_INV, /* German NRC */
  402. "iso646-dk", FC_NOASCII, CM_INV, /* Norwegian and Danish NRC */
  403. "iso646-es", FC_SPASCII, CM_INV, /* Spanish NRC */
  404. "iso646-fi", FC_FIASCII, CM_INV, /* Finnish NRC */
  405. "iso646-fr", FC_FRASCII, CM_INV, /* French NRC */
  406. "iso646-hu", FC_HUASCII, CM_INV, /* Hungarian NRC */
  407. "iso646-it", FC_ITASCII, CM_INV, /* Italian NRC */
  408. "iso646-no", FC_NOASCII, CM_INV, /* Norwegian and Danish NRC */
  409. "iso646-po", FC_POASCII, CM_INV, /* Portuguese NRC */
  410. "iso646-se", FC_SWASCII, CM_INV, /* Swedish NRC */
  411. "italian", FC_ITASCII, CM_INV, /* Italian NRC */
  412. #ifdef KANJI
  413. "japanese-euc", FC_JEUC, CM_INV, /* Japanese EUC */
  414. "jis7-kanji", FC_JIS7, 0, /* Japanese JIS7 7bit code */
  415. #endif /* KANJI */
  416. #ifdef CYRILLIC
  417. "k", FC_KOI8, CM_ABR|CM_INV,
  418. "ko", FC_KOI8, CM_ABR|CM_INV,
  419. "koi", FC_KOI8, CM_ABR|CM_INV,
  420. "koi7", FC_KOI7, 0, /* Short KOI Cyrillic */
  421. "koi8", FC_KOI8, 0, /* Old KOI-8 Cyrillic */
  422. "koi8-e", FC_KOI8, CM_INV, /* Old KOI-8 Cyrillic */
  423. "koi8-cyrillic", FC_KOI8, CM_INV,
  424. "koi8-r", FC_KOI8R, CM_INV, /* KOI8-R RFC1489 */
  425. "koi8-u", FC_KOI8U, CM_INV, /* KOI8-U RFC2319 */
  426. "koi8r", FC_KOI8R, 0, /* KOI8-R RFC1489 */
  427. "koi8u", FC_KOI8U, 0, /* KOI8-U RFC2319 */
  428. #endif /* CYRILLIC */
  429. "l", FC_1LATIN, CM_ABR|CM_INV,
  430. "la", FC_1LATIN, CM_ABR|CM_INV,
  431. "lat", FC_1LATIN, CM_ABR|CM_INV,
  432. "lati", FC_1LATIN, CM_ABR|CM_INV,
  433. "latin", FC_1LATIN, CM_ABR|CM_INV,
  434. "latin1-iso", FC_1LATIN, 0, /* ISO Latin Alphabet 1 */
  435. #ifdef LATIN2
  436. "latin2-iso", FC_2LATIN, 0, /* ISO Latin Alphabet 2 */
  437. #endif /* LATIN2 */
  438. "latin9-iso", FC_9LATIN, 0, /* ISO Latin Alphabet 9 */
  439. "macintosh-latin", FC_APPQD, 0, /* "Extended Mac Latin" */
  440. #ifdef LATIN2
  441. "mazovia-pc", FC_MAZOVIA, 0, /* Polish Mazovia PC code page */
  442. #endif /* LATIN2 */
  443. "next-multinational", FC_NEXT, 0, /* NeXT workstation */
  444. "norwegian", FC_NOASCII, 0, /* Norwegian and Danish NRC */
  445. "portuguese", FC_POASCII, 0, /* Portuguese NRC */
  446. #ifdef KANJI
  447. "shift-jis-kanji", FC_SHJIS, 0, /* Japanese Kanji Shift-JIS */
  448. "shift_jis", FC_SHJIS, CM_INV, /* Japanese Kanji Shift-JIS */
  449. #endif /* KANJI */
  450. #ifdef CYRILLIC
  451. "short-koi", FC_KOI7, 0, /* Short KOI Cyrillic */
  452. #endif /* CYRILLIC */
  453. "spanish", FC_SPASCII, 0, /* Spanish NRC */
  454. "swedish", FC_SWASCII, 0, /* Swedish NRC */
  455. "swiss", FC_CHASCII, 0, /* Swiss NRC */
  456. #ifdef UNICODE
  457. "ucs2", FC_UCS2, 0, /* ISO 10646 / Unicode UCS-2 */
  458. #endif /* UNICODE */
  459. "us-ascii", FC_USASCII, CM_INV, /* MIME */
  460. "usascii", FC_USASCII, CM_INV,
  461. #ifdef UNICODE
  462. "utf-8", FC_UTF8, CM_INV, /* ISO 10646 / Unicode UTF-8 */
  463. "utf8", FC_UTF8, 0, /* ISO 10646 / Unicode UTF-8 */
  464. #endif /* UNICODE */
  465. #ifdef LATIN2
  466. "windows-1250", FC_CP1250, CM_INV, /* Windows CP 1250 */
  467. #endif /* LATIN2 */
  468. #ifdef CYRILLIC
  469. "windows-1251", FC_CP1251, CM_INV, /* Windows CP 1251 */
  470. #endif /* CYRILLIC */
  471. "windows-1252", FC_CP1252, CM_INV, /* Windows CP 1252 */
  472. "", 0, 0
  473. };
  474. int nfilc = (sizeof(fcstab) / sizeof(struct keytab)) - 1;
  475. struct keytab ttcstab[] = { /* Keyword table for SET TERMINAL CHARACTER-SET */
  476. /*
  477. IMPORTANT: This table is a replica of fcstab, immediately above, with the
  478. addition of TRANSPARENT and deletion of the Japanese sets. If you make
  479. changes to this table, make the corresponding changes to fcstab.
  480. */
  481. /* Keyword Value Flags */
  482. "apple-quickdraw", FC_APPQD, CM_INV, /* Apple Quickdraw */
  483. "ascii", FC_USASCII, 0, /* ASCII */
  484. "british", FC_UKASCII, 0, /* British NRC */
  485. "bulgaria-pc", FC_BULGAR, 0, /* Bulgarian PC Code Page */
  486. "canadian-french", FC_FCASCII, 0, /* French Canadian NRC */
  487. #ifdef LATIN2
  488. "cp1250", FC_CP1250, 0, /* Windows CP 1250 */
  489. #endif /* LATIN2 */
  490. #ifdef CYRILLIC
  491. "cp1251-cyrillic", FC_CP1251, 0, /* Windows CP 1251 */
  492. #endif /* CYRILLIC */
  493. "cp1252", FC_CP1252, 0, /* Windows CP 1252 */
  494. "cp437", FC_CP437, 0, /* PC CP437 */
  495. "cp850", FC_CP850, 0, /* PC CP850 */
  496. #ifdef LATIN2
  497. "cp852", FC_CP852, 0, /* PC CP852 */
  498. #endif /* LATIN2 */
  499. #ifdef CYRILLIC
  500. "cp855-cyrillic", FC_CP855, 0, /* PC CP855 */
  501. #endif /* CYRILLIC */
  502. "cp858", FC_CP858, 0, /* PC CP858 */
  503. #ifdef HEBREW
  504. "cp862-hebrew", FC_CP862, 0, /* PC CP862 */
  505. #endif /* HEBREW */
  506. #ifdef CYRILLIC
  507. "cp866-cyrillic", FC_CP866, 0, /* CP866 Cyrillic */
  508. #endif /* CYRILLIC */
  509. #ifdef GREEK
  510. "cp869-greek", FC_CP869, 0, /* CP869 Greek */
  511. #endif /* GREEK */
  512. #ifdef CYRILLIC
  513. "cyrillic-iso", FC_CYRILL, 0, /* ISO Latin/Cyrillic Alphabet */
  514. #endif /* CYRILLIC */
  515. "danish", FC_NOASCII, 0, /* Norwegian and Danish NRC */
  516. "dec-mcs", FC_DECMCS, CM_INV, /* DEC multinational char set */
  517. "dec-multinational", FC_DECMCS, 0, /* DEC multinational character set */
  518. "dg-international", FC_DGMCS, 0, /* Data General multinational */
  519. "dutch", FC_DUASCII, 0, /* Dutch NRC */
  520. #ifdef GREEK
  521. "elot927-greek", FC_ELOT, 0, /* ELOT 927 Greek */
  522. "elot928-greek", FC_GREEK, 0, /* Same as ISO 8859-7 Latin/Greek */
  523. #endif /* GREEK */
  524. "finnish", FC_FIASCII, 0, /* Finnish NRC */
  525. "french", FC_FRASCII, 0, /* French NRC */
  526. "fr-canadian", FC_FCASCII, CM_INV, /* French Canadian NRC */
  527. "german", FC_GEASCII, 0, /* German NRC */
  528. #ifdef GREEK
  529. "greek-iso", FC_GREEK, 0, /* ISO 8859-7 Latin/Greek */
  530. #endif /* GREEK */
  531. #ifdef HEBREW
  532. "he", FC_HEBREW, CM_ABR|CM_INV,
  533. "heb", FC_HEBREW, CM_ABR|CM_INV,
  534. "hebr", FC_HEBREW, CM_ABR|CM_INV,
  535. "hebre", FC_HEBREW, CM_ABR|CM_INV,
  536. "hebrew", FC_HEBREW, CM_ABR|CM_INV,
  537. "hebrew-7", FC_HE7, 0, /* DEC 7-Bit Hebrew */
  538. "hebrew-iso", FC_HEBREW, 0, /* ISO Latin/Hebrew */
  539. #endif /* HEBREW */
  540. "hp-roman8", FC_HPR8, 0, /* Hewlett Packard Roman8 */
  541. "hungarian", FC_HUASCII, 0, /* Hungarian NRC */
  542. "ibm437", FC_CP437, CM_INV, /* PC CP437 */
  543. "ibm850", FC_CP850, CM_INV, /* PC CP850 (not in MIME) */
  544. #ifdef LATIN2
  545. "ibm852", FC_CP852, CM_INV, /* PC CP852 */
  546. #endif /* LATIN2 */
  547. #ifdef CYRILLIC
  548. "ibm855", FC_CP855, CM_INV, /* PC CP855 */
  549. #endif /* CYRILLIC */
  550. "ibm858", FC_CP858, CM_INV, /* PC CP858 (not in MIME) */
  551. #ifdef HEBREW
  552. "ibm862", FC_CP862, CM_INV, /* PC CP862 (not in MIME) */
  553. #endif /* HEBREW */
  554. #ifdef CYRILLIC
  555. "ibm866", FC_CP866, CM_INV, /* CP866 Cyrillic */
  556. #endif /* CYRILLIC */
  557. #ifdef GREEK
  558. "ibm869", FC_CP869, CM_INV, /* CP869 Greek */
  559. #endif /* GREEK */
  560. #ifdef UNICODE
  561. "iso-10646-ucs-2", FC_UCS2, CM_INV, /* ISO 10646 / Unicode UCS-2 */
  562. #endif /* UNICODE */
  563. "iso-8859-1", FC_1LATIN, CM_INV, /* ISO Latin Alphabet 1 */
  564. "iso-8859-15", FC_9LATIN, CM_INV, /* ISO Latin Alphabet 9 (yes) */
  565. "iso-8859-2", FC_2LATIN, CM_INV, /* ISO Latin Alphabet 2 */
  566. #ifdef CYRILLIC
  567. "iso-8859-5", FC_CYRILL, CM_INV, /* ISO Latin/Cyrillic Alphabet */
  568. #endif /* CYRILLIC */
  569. #ifdef GREEK
  570. "iso-8859-7", FC_GREEK, CM_INV, /* ISO 8859-7 Latin/Greek */
  571. #endif /* GREEK */
  572. #ifdef HEBREW
  573. "iso-8859-8", FC_HEBREW, CM_INV, /* ISO Latin/Hebrew */
  574. #endif /* HEBREW */
  575. "iso646-gb", FC_UKASCII, CM_INV, /* British NRC */
  576. "iso646-ca", FC_FCASCII, CM_INV, /* French Canadian NRC */
  577. "iso646-de", FC_GEASCII, CM_INV, /* German NRC */
  578. "iso646-dk", FC_NOASCII, CM_INV, /* Norwegian and Danish NRC */
  579. "iso646-es", FC_SPASCII, CM_INV, /* Spanish NRC */
  580. "iso646-fi", FC_FIASCII, CM_INV, /* Finnish NRC */
  581. "iso646-fr", FC_FRASCII, CM_INV, /* French NRC */
  582. "iso646-hu", FC_HUASCII, CM_INV, /* Hungarian NRC */
  583. "iso646-it", FC_ITASCII, CM_INV, /* Italian NRC */
  584. "iso646-no", FC_NOASCII, CM_INV, /* Norwegian and Danish NRC */
  585. "iso646-po", FC_POASCII, CM_INV, /* Portuguese NRC */
  586. "iso646-se", FC_SWASCII, CM_INV, /* Swedish NRC */
  587. "italian", FC_ITASCII, CM_INV, /* Italian NRC */
  588. #ifdef CYRILLIC
  589. "k", FC_KOI8, CM_ABR|CM_INV,
  590. "ko", FC_KOI8, CM_ABR|CM_INV,
  591. "koi", FC_KOI8, CM_ABR|CM_INV,
  592. "koi7", FC_KOI7, 0, /* Short KOI Cyrillic */
  593. "koi8", FC_KOI8, 0, /* Old KOI-8 Cyrillic */
  594. "koi8-e", FC_KOI8, CM_INV, /* Old KOI-8 Cyrillic */
  595. "koi8-cyrillic", FC_KOI8, CM_INV,
  596. "koi8-r", FC_KOI8R, CM_INV, /* KOI8-R RFC1489 */
  597. "koi8-u", FC_KOI8U, CM_INV, /* KOI8-U RFC2319 */
  598. "koi8r", FC_KOI8R, 0, /* KOI8-R RFC1489 */
  599. "koi8u", FC_KOI8U, 0, /* KOI8-U RFC2319 */
  600. #endif /* CYRILLIC */
  601. "l", FC_1LATIN, CM_ABR|CM_INV,
  602. "la", FC_1LATIN, CM_ABR|CM_INV,
  603. "lat", FC_1LATIN, CM_ABR|CM_INV,
  604. "lati", FC_1LATIN, CM_ABR|CM_INV,
  605. "latin", FC_1LATIN, CM_ABR|CM_INV,
  606. "latin1-iso", FC_1LATIN, 0, /* ISO Latin Alphabet 1 */
  607. #ifdef LATIN2
  608. "latin2-iso", FC_2LATIN, 0, /* ISO Latin Alphabet 2 */
  609. #endif /* LATIN2 */
  610. "latin9-iso", FC_9LATIN, 0, /* ISO Latin Alphabet 9 */
  611. "macintosh-latin", FC_APPQD, 0, /* "Extended Mac Latin" */
  612. #ifdef LATIN2
  613. "mazovia-pc", FC_MAZOVIA, 0, /* Polish Mazovia PC code page */
  614. #endif /* LATIN2 */
  615. "next-multinational", FC_NEXT, 0, /* NeXT workstation */
  616. "norwegian", FC_NOASCII, 0, /* Norwegian and Danish NRC */
  617. "portuguese", FC_POASCII, 0, /* Portuguese NRC */
  618. #ifdef CYRILLIC
  619. "short-koi", FC_KOI7, 0, /* Short KOI Cyrillic */
  620. #endif /* CYRILLIC */
  621. "spanish", FC_SPASCII, 0, /* Spanish NRC */
  622. "swedish", FC_SWASCII, 0, /* Swedish NRC */
  623. "swiss", FC_CHASCII, 0, /* Swiss NRC */
  624. "transparent", FC_TRANSP, 0, /* Transparent */
  625. #ifdef UNICODE
  626. "ucs2", FC_UCS2, 0, /* ISO 10646 / Unicode UCS-2 */
  627. #endif /* UNICODE */
  628. "us-ascii", FC_USASCII, CM_INV, /* MIME */
  629. "usascii", FC_USASCII, CM_INV,
  630. #ifdef UNICODE
  631. "utf-8", FC_UTF8, CM_INV, /* ISO 10646 / Unicode UTF-8 */
  632. "utf8", FC_UTF8, 0, /* ISO 10646 / Unicode UTF-8 */
  633. #endif /* UNICODE */
  634. #ifdef LATIN2
  635. "windows-1250", FC_CP1250, CM_INV, /* Windows CP 1250 */
  636. #endif /* LATIN2 */
  637. #ifdef CYRILLIC
  638. "windows-1251", FC_CP1251, CM_INV, /* Windows CP 1251 */
  639. #endif /* CYRILLIC */
  640. "windows-1252", FC_CP1252, CM_INV, /* Windows CP 1252 */
  641. "", 0, 0
  642. };
  643. int ntermc = (sizeof(ttcstab) / sizeof(struct keytab)) - 1;
  644. /* This table contains the equivalent FCS number for each TCS. */
  645. /* If the TC_xxx symbol definitions are ever changed, fix this table. */
  646. /* Ditto if another TCS is added. */
  647. int
  648. cseqtab[MAXTCSETS+1] = { /* TCS/FCS equivalency table */
  649. -1, /* 0 = Transparent */
  650. FC_USASCII, /* 1 = ASCII */
  651. FC_1LATIN, /* 2 = Latin-1 */
  652. FC_2LATIN, /* 3 = Latin-2 */
  653. FC_CYRILL, /* 4 = Latin/Cyrillic */
  654. FC_JEUC, /* 5 = Japanese EUC */
  655. FC_HEBREW, /* 6 = Latin/Hebrew */
  656. FC_GREEK, /* 7 = Latin/Greek */
  657. FC_9LATIN, /* 8 = Latin-9 */
  658. FC_UCS2, /* 9 = UCS-2 */
  659. FC_UTF8 /* 10 = UTF-8 */
  660. };
  661. /*
  662. Languages:
  663. This table allows C-Kermit to have a SET LANGUAGE command to apply special
  664. language-specific rules when translating from a character set that contains
  665. national characters into plain ASCII, like German umlaut-a becomes ae.
  666. Originally, I thought it would be a good idea to let SET LANGUAGE also select
  667. an appropriate FILE CHARACTER-SET and TRANSFER CHARACTER-SET automatically,
  668. and these are included in the langinfo structure. Later I realized that this
  669. was a bad idea. Any particular language (e.g. Dutch) can be represented by
  670. many different and incompatible character sets.
  671. (But we could use the new (1998) ASSOCIATE command for this...)
  672. */
  673. struct langinfo langs[] = {
  674. /* Language code File Charset Xfer Charset Name */
  675. L_USASCII, FC_USASCII, TC_USASCII, "ASCII (American English)",
  676. L_DANISH, FC_NOASCII, TC_1LATIN, "Danish",
  677. L_DUTCH, FC_DUASCII, TC_1LATIN, "Dutch",
  678. L_FINNISH, FC_FIASCII, TC_1LATIN, "Finnish",
  679. L_FRENCH, FC_FRASCII, TC_1LATIN, "French",
  680. L_GERMAN, FC_GEASCII, TC_1LATIN, "German",
  681. #ifdef GREEK
  682. L_GREEK, FC_GREEK, TC_GREEK, "Greek",
  683. #endif /* GREEK */
  684. #ifdef HEBREW
  685. L_HEBREW, FC_HEBREW, TC_HEBREW, "Hebrew",
  686. #endif /* HEBREW */
  687. L_HUNGARIAN, FC_HUASCII, TC_2LATIN, "Hungarian",
  688. L_ICELANDIC, FC_USASCII, TC_1LATIN, "Icelandic",
  689. L_ITALIAN, FC_ITASCII, TC_1LATIN, "Italian",
  690. #ifdef KANJI
  691. L_JAPANESE, FC_JEUC, TC_JEUC, "Japanese",
  692. #endif /* KANJI */
  693. L_NORWEGIAN, FC_NOASCII, TC_1LATIN, "Norwegian",
  694. L_PORTUGUESE, FC_POASCII, TC_1LATIN, "Portuguese",
  695. #ifdef CYRILLIC
  696. L_RUSSIAN, FC_CP866, TC_CYRILL, "Russian",
  697. #endif /* CYRILLIC */
  698. L_SPANISH, FC_SPASCII, TC_1LATIN, "Spanish",
  699. L_SWEDISH, FC_SWASCII, TC_1LATIN, "Swedish",
  700. L_SWISS, FC_CHASCII, TC_1LATIN, "Swiss"
  701. };
  702. int nlangs = (sizeof(langs) / sizeof(struct langinfo));
  703. /*
  704. Keyword table for the SET LANGUAGE command.
  705. Only a few of these (German, Scandinavian, etc) actually do anything.
  706. The language is used to invoke special translation rules when converting
  707. from an 8-bit character set to ASCII; for example, German u-diaeresis
  708. becomes "ue", Dutch y-diaeresis becomes "ij". Languages without associated
  709. rules are invisible (CM_INV).
  710. */
  711. struct keytab lngtab[] = {
  712. "ascii", L_USASCII, CM_INV,
  713. "danish", L_DANISH, 0,
  714. "dutch", L_DUTCH, 0,
  715. "english", L_USASCII, CM_INV,
  716. "finnish", L_FINNISH, 0,
  717. "french", L_FRENCH, 0,
  718. "german", L_GERMAN, 0,
  719. #ifdef GREEK
  720. "greek", L_GREEK, CM_INV,
  721. #endif /* GREEK */
  722. #ifdef HEBREW
  723. "hebrew", L_HEBREW, CM_INV,
  724. #endif /* HEBREW */
  725. "hungarian", L_HUNGARIAN, CM_INV,
  726. "icelandic", L_ICELANDIC, 0,
  727. "italian", L_ITALIAN, CM_INV,
  728. #ifdef KANJI
  729. "japanese", L_JAPANESE, CM_INV,
  730. #endif /* KANJI */
  731. "norwegian", L_NORWEGIAN, 0,
  732. "none", L_USASCII, 0,
  733. "portuguese", L_PORTUGUESE, CM_INV,
  734. #ifdef CYRILLIC
  735. "russian", L_RUSSIAN, 0,
  736. #endif /* CYRILLIC */
  737. "spanish", L_SPANISH, CM_INV,
  738. "swedish", L_SWEDISH, 0,
  739. #ifdef CYRILLIC
  740. "ukrainian", L_RUSSIAN, 0,
  741. #endif /* CYRILLIC */
  742. "", 0, 0
  743. };
  744. int nlng = (sizeof(lngtab) / sizeof(struct keytab)) - 1; /* how many */
  745. /* Translation tables ... */
  746. /*
  747. For each pair of (transfer,file) character sets, we need two translation
  748. functions, one for sending, one for receiving.
  749. */
  750. /*
  751. Here is the first table, Latin-1 to ASCII, fully annotated...
  752. This one is absolutely NOT invertible, since we're going from an 8-bit
  753. set to a 7-bit set. Accented letters are mapped to unaccented
  754. equivalents, C1 control characters are all translated to "?", etc.
  755. */
  756. CONST CHAR
  757. yl1as[] = { /* ISO 8859-1 Latin Alphabet 1 to US ASCII */
  758. /* Source character Description => Translation */
  759. /* Dec row/col Set */
  760. 0, /* 000 00/00 C0 NUL Ctrl-@ => (self) */
  761. 1, /* 001 00/01 C0 SOH Ctrl-A => (self) */
  762. 2, /* 002 00/02 C0 STX Ctrl-B => (self) */
  763. 3, /* 003 00/03 C0 ETX Ctrl-C => (self) */
  764. 4, /* 004 00/04 C0 EOT Ctrl-D => (self) */
  765. 5, /* 005 00/05 C0 ENQ Ctrl-E => (self) */
  766. 6, /* 006 00/06 C0 ACK Ctrl-F => (self) */
  767. 7, /* 007 00/07 C0 BEL Ctrl-G => (self) */
  768. 8, /* 008 00/08 C0 BS Ctrl-H => (self) */
  769. 9, /* 009 00/09 C0 HT Ctrl-I => (self) */
  770. 10, /* 010 00/10 C0 LF Ctrl-J => (self) */
  771. 11, /* 011 00/11 C0 VT Ctrl-K => (self) */
  772. 12, /* 012 00/12 C0 FF Ctrl-L => (self) */
  773. 13, /* 013 00/13 C0 CR Ctrl-M => (self) */
  774. 14, /* 014 00/14 C0 SO Ctrl-N => (self) */
  775. 15, /* 015 00/15 C0 SI Ctrl-O => (self) */
  776. 16, /* 016 01/00 C0 DLE Ctrl-P => (self) */
  777. 17, /* 017 01/01 C0 DC1 Ctrl-Q => (self) */
  778. 18, /* 018 01/02 C0 DC2 Ctrl-R => (self) */
  779. 19, /* 019 01/03 C0 DC3 Ctrl-S => (self) */
  780. 20, /* 020 01/04 C0 DC4 Ctrl-T => (self) */
  781. 21, /* 021 01/05 C0 NAK Ctrl-U => (self) */
  782. 22, /* 022 01/06 C0 SYN Ctrl-V => (self) */
  783. 23, /* 023 01/07 C0 ETB Ctrl-W => (self) */
  784. 24, /* 024 01/08 C0 CAN Ctrl-X => (self) */
  785. 25, /* 025 01/09 C0 EM Ctrl-Y => (self) */
  786. 26, /* 026 01/10 C0 SUB Ctrl-Z => (self) */
  787. 27, /* 027 01/11 C0 ESC Ctrl-[ => (self) */
  788. 28, /* 028 01/12 C0 FS Ctrl-\ => (self) */
  789. 29, /* 029 01/13 C0 GS Ctrl-] => (self) */
  790. 30, /* 030 01/14 C0 RS Ctrl-^ => (self) */
  791. 31, /* 031 01/15 C0 US Ctrl-_ => (self) */
  792. 32, /* 032 02/00 SP Space => (self) */
  793. 33, /* 033 02/01 G0 ! Exclamation mark => (self) */
  794. 34, /* 034 02/02 G0 " Doublequote => (self) */
  795. 35, /* 035 02/03 G0 # Number sign => (self) */
  796. 36, /* 036 02/04 G0 $ Dollar sign => (self) */
  797. 37, /* 037 02/05 G0 % Percent sign => (self) */
  798. 38, /* 038 02/06 G0 & Ampersand => (self) */
  799. 39, /* 039 02/07 G0 ' Apostrophe => (self) */
  800. 40, /* 040 02/08 G0 ( Left parenthesis => (self) */
  801. 41, /* 041 02/09 G0 ) Right parenthesis => (self) */
  802. 42, /* 042 02/10 G0 * Asterisk => (self) */
  803. 43, /* 043 02/11 G0 + Plus sign => (self) */
  804. 44, /* 044 02/12 G0 , Comma => (self) */
  805. 45, /* 045 02/13 G0 - Hyphen, minus sign => (self) */
  806. 46, /* 046 02/14 G0 . Period, full stop => (self) */
  807. 47, /* 047 02/15 G0 / Slash, solidus => (self) */
  808. 48, /* 048 03/00 G0 0 Digit 0 => (self) */
  809. 49, /* 049 03/01 G0 1 Digit 1 => (self) */
  810. 50, /* 050 03/02 G0 2 Digit 2 => (self) */
  811. 51, /* 051 03/03 G0 3 Digit 3 => (self) */
  812. 52, /* 052 03/04 G0 4 Digit 4 => (self) */
  813. 53, /* 053 03/05 G0 5 Digit 5 => (self) */
  814. 54, /* 054 03/06 G0 6 Digit 6 => (self) */
  815. 55, /* 055 03/07 G0 7 Digit 7 => (self) */
  816. 56, /* 056 03/08 G0 8 Digit 8 => (self) */
  817. 57, /* 057 03/09 G0 9 Digit 9 => (self) */
  818. 58, /* 058 03/10 G0 : Colon => (self) */
  819. 59, /* 059 03/11 G0 ; Semicolon => (self) */
  820. 60, /* 060 03/12 G0 < Less-than sign => (self) */
  821. 61, /* 061 03/13 G0 = Equals sign => (self) */
  822. 62, /* 062 03/14 G0 > Greater-than sign => (self) */
  823. 63, /* 063 03/15 G0 ? Question mark => (self) */
  824. 64, /* 064 04/00 G0 @ Commercial at sign => (self) */
  825. 65, /* 065 04/01 G0 A Letter A => (self) */
  826. 66, /* 066 04/02 G0 B Letter B => (self) */
  827. 67, /* 067 04/03 G0 C Letter C => (self) */
  828. 68, /* 068 04/04 G0 D Letter D => (self) */
  829. 69, /* 069 04/05 G0 E Letter E => (self) */
  830. 70, /* 070 04/06 G0 F Letter F => (self) */
  831. 71, /* 071 04/07 G0 G Letter G => (self) */
  832. 72, /* 072 04/08 G0 H Letter H => (self) */
  833. 73, /* 073 04/09 G0 I Letter I => (self) */
  834. 74, /* 074 04/10 G0 J Letter J => (self) */
  835. 75, /* 075 04/11 G0 K Letter K => (self) */
  836. 76, /* 076 04/12 G0 L Letter L => (self) */
  837. 77, /* 077 04/13 G0 M Letter M => (self) */
  838. 78, /* 078 04/14 G0 N Letter N => (self) */
  839. 79, /* 079 04/15 G0 O Letter O => (self) */
  840. 80, /* 080 05/00 G0 P Letter P => (self) */
  841. 81, /* 081 05/01 G0 Q Letter Q => (self) */
  842. 82, /* 082 05/02 G0 R Letter R => (self) */
  843. 83, /* 083 05/03 G0 S Letter S => (self) */
  844. 84, /* 084 05/04 G0 T Letter T => (self) */
  845. 85, /* 085 05/05 G0 U Letter U => (self) */
  846. 86, /* 086 05/06 G0 V Letter V => (self) */
  847. 87, /* 087 05/07 G0 W Letter W => (self) */
  848. 88, /* 088 05/08 G0 X Letter X => (self) */
  849. 89, /* 089 05/09 G0 Y Letter Y => (self) */
  850. 90, /* 090 05/10 G0 Z Letter Z => (self) */
  851. 91, /* 091 05/11 G0 [ Left square bracket => (self) */
  852. 92, /* 092 05/12 G0 \ Reverse slash => (self) */
  853. 93, /* 093 05/13 G0 ] Right square bracket => (self) */
  854. 94, /* 094 05/14 G0 ^ Circumflex accent => (self) */
  855. 95, /* 095 05/15 G0 _ Underline, low line => (self) */
  856. 96, /* 096 06/00 G0 ` Grave accent => (self) */
  857. 97, /* 097 06/01 G0 a Letter a => (self) */
  858. 98, /* 098 06/02 G0 b Letter b => (self) */
  859. 99, /* 099 06/03 G0 c Letter c => (self) */
  860. 100, /* 100 06/04 G0 d Letter d => (self) */
  861. 101, /* 101 06/05 G0 e Letter e => (self) */
  862. 102, /* 102 06/06 G0 f Letter f => (self) */
  863. 103, /* 103 06/07 G0 g Letter g => (self) */
  864. 104, /* 104 06/08 G0 h Letter h => (self) */
  865. 105, /* 105 06/09 G0 i Letter i => (self) */
  866. 106, /* 106 06/10 G0 j Letter j => (self) */
  867. 107, /* 107 06/11 G0 k Letter k => (self) */
  868. 108, /* 108 06/12 G0 l Letter l => (self) */
  869. 109, /* 109 06/13 G0 m Letter m => (self) */
  870. 110, /* 110 06/14 G0 n Letter n => (self) */
  871. 111, /* 111 06/15 G0 o Letter o => (self) */
  872. 112, /* 112 07/00 G0 p Letter p => (self) */
  873. 113, /* 113 07/01 G0 q Letter q => (self) */
  874. 114, /* 114 07/02 G0 r Letter r => (self) */
  875. 115, /* 115 07/03 G0 s Letter s => (self) */
  876. 116, /* 116 07/04 G0 t Letter t => (self) */
  877. 117, /* 117 07/05 G0 u Letter u => (self) */
  878. 118, /* 118 07/06 G0 v Letter v => (self) */
  879. 119, /* 119 07/07 G0 w Letter w => (self) */
  880. 120, /* 120 07/08 G0 x Letter x => (self) */
  881. 121, /* 121 07/09 G0 y Letter y => (self) */
  882. 122, /* 122 07/10 G0 z Letter z => (self) */
  883. 123, /* 123 07/11 G0 { Left curly bracket => (self) */
  884. 124, /* 124 07/12 G0 | Vertical bar => (self) */
  885. 125, /* 125 07/13 G0 } Right curly bracket => (self) */
  886. 126, /* 126 07/14 G0 ~ Tilde => (self) */
  887. 127, /* 127 07/15 DEL Delete, Rubout => (self) */
  888. UNK, /* 128 08/00 C1 => UNK */
  889. UNK, /* 129 08/01 C1 => UNK */
  890. UNK, /* 130 08/02 C1 => UNK */
  891. UNK, /* 131 08/03 C1 => UNK */
  892. UNK, /* 132 08/04 C1 IND => UNK */
  893. UNK, /* 133 08/05 C1 NEL => UNK */
  894. UNK, /* 134 08/06 C1 SSA => UNK */
  895. UNK, /* 135 08/07 C1 ESA => UNK */
  896. UNK, /* 136 08/08 C1 HTS => UNK */
  897. UNK, /* 137 08/09 C1 => UNK */
  898. UNK, /* 138 08/10 C1 => UNK */
  899. UNK, /* 139 08/11 C1 => UNK */
  900. UNK, /* 140 08/12 C1 => UNK */
  901. UNK, /* 141 08/13 C1 RI => UNK */
  902. UNK, /* 142 08/14 C1 SS2 => UNK */
  903. UNK, /* 143 08/15 C1 SS3 => UNK */
  904. UNK, /* 144 09/00 C1 DCS => UNK */
  905. UNK, /* 145 09/01 C1 => UNK */
  906. UNK, /* 146 09/02 C1 => UNK */
  907. UNK, /* 147 09/03 C1 STS => UNK */
  908. UNK, /* 148 09/04 C1 => UNK */
  909. UNK, /* 149 09/05 C1 => UNK */
  910. UNK, /* 150 09/06 C1 SPA => UNK */
  911. UNK, /* 151 09/07 C1 EPA => UNK */
  912. UNK, /* 152 09/08 C1 => UNK */
  913. UNK, /* 153 09/09 C1 => UNK */
  914. UNK, /* 154 09/10 C1 => UNK */
  915. UNK, /* 155 09/11 C1 CSI => UNK */
  916. UNK, /* 156 09/12 C1 ST => UNK */
  917. UNK, /* 157 09/13 C1 OSC => UNK */
  918. UNK, /* 158 09/14 C1 PM => UNK */
  919. UNK, /* 159 09/15 C1 APC => UNK */
  920. 32, /* 160 10/00 G1 No-break space => SP */
  921. 33, /* 161 10/01 G1 Inverted exclamation => ! */
  922. 99, /* 162 10/02 G1 Cent sign => c */
  923. 35, /* 163 10/03 G1 Pound sign => # */
  924. 36, /* 164 10/04 G1 Currency sign => $ */
  925. 89, /* 165 10/05 G1 Yen sign => Y */
  926. 124, /* 166 10/06 G1 Broken bar => | */
  927. 80, /* 167 10/07 G1 Paragraph sign => P */
  928. 34, /* 168 10/08 G1 Diaeresis => " */
  929. 67, /* 169 10/09 G1 Copyright sign => C */
  930. 97, /* 170 10/10 G1 Feminine ordinal => a */
  931. 34, /* 171 10/11 G1 Left angle quotation => " */
  932. 126, /* 172 10/12 G1 Not sign => ~ */
  933. 45, /* 173 10/13 G1 Soft hyphen => - */
  934. 82, /* 174 10/14 G1 Registered trade mark => R */
  935. 95, /* 175 10/15 G1 Macron => _ */
  936. 111, /* 176 11/00 G1 Degree sign, ring above => o */
  937. UNK, /* 177 11/01 G1 Plus-minus sign => UNK */
  938. 50, /* 178 11/02 G1 Superscript two => 2 */
  939. 51, /* 179 11/03 G1 Superscript three => 3 */
  940. 39, /* 180 11/04 G1 Acute accent => ' */
  941. 117, /* 181 11/05 G1 Micro sign => u */
  942. 45, /* 182 11/06 G1 Pilcrow sign => - */
  943. 45, /* 183 11/07 G1 Middle dot => - */
  944. 44, /* 184 11/08 G1 Cedilla => , */
  945. 49, /* 185 11/09 G1 Superscript one => 1 */
  946. 111, /* 186 11/10 G1 Masculine ordinal => o */
  947. 34, /* 187 11/11 G1 Right angle quotation => " */
  948. UNK, /* 188 11/12 G1 One quarter => UNK */
  949. UNK, /* 189 11/13 G1 One half => UNK */
  950. UNK, /* 190 11/14 G1 Three quarters => UNK */
  951. 63, /* 191 11/15 G1 Inverted question mark => ? */
  952. 65, /* 192 12/00 G1 A grave => A */
  953. 65, /* 193 12/01 G1 A acute => A */
  954. 65, /* 194 12/02 G1 A circumflex => A */
  955. 65, /* 195 12/03 G1 A tilde => A */
  956. 65, /* 196 12/04 G1 A diaeresis => A */
  957. 65, /* 197 12/05 G1 A ring above => A */
  958. 65, /* 198 12/06 G1 A with E => A */
  959. 67, /* 199 12/07 G1 C Cedilla => C */
  960. 69, /* 200 12/08 G1 E grave => E */
  961. 69, /* 201 12/09 G1 E acute => E */
  962. 69, /* 202 12/10 G1 E circumflex => E */
  963. 69, /* 203 12/11 G1 E diaeresis => E */
  964. 73, /* 204 12/12 G1 I grave => I */
  965. 73, /* 205 12/13 G1 I acute => I */
  966. 73, /* 206 12/14 G1 I circumflex => I */
  967. 73, /* 207 12/15 G1 I diaeresis => I */
  968. 68, /* 208 13/00 G1 Icelandic Eth => D */
  969. 78, /* 209 13/01 G1 N tilde => N */
  970. 79, /* 210 13/02 G1 O grave => O */
  971. 79, /* 211 13/03 G1 O acute => O */
  972. 79, /* 212 13/04 G1 O circumflex => O */
  973. 79, /* 213 13/05 G1 O tilde => O */
  974. 79, /* 214 13/06 G1 O diaeresis => O */
  975. 120, /* 215 13/07 G1 Multiplication sign => x */
  976. 79, /* 216 13/08 G1 O oblique stroke => O */
  977. 85, /* 217 13/09 G1 U grave => U */
  978. 85, /* 218 13/10 G1 U acute => U */
  979. 85, /* 219 13/11 G1 U circumflex => U */
  980. 85, /* 220 13/12 G1 U diaeresis => U */
  981. 89, /* 221 13/13 G1 Y acute => Y */
  982. 84, /* 222 13/14 G1 Icelandic Thorn => T */
  983. 115, /* 223 13/15 G1 German sharp s => s */
  984. 97, /* 224 14/00 G1 a grave => a */
  985. 97, /* 225 14/01 G1 a acute => a */
  986. 97, /* 226 14/02 G1 a circumflex => a */
  987. 97, /* 227 14/03 G1 a tilde => a */
  988. 97, /* 228 14/04 G1 a diaeresis => a */
  989. 97, /* 229 14/05 G1 a ring above => a */
  990. 97, /* 230 14/06 G1 a with e => a */
  991. 99, /* 231 14/07 G1 c cedilla => c */
  992. 101, /* 232 14/08 G1 e grave => e */
  993. 101, /* 233 14/09 G1 e acute => e */
  994. 101, /* 234 14/10 G1 e circumflex => e */
  995. 101, /* 235 14/11 G1 e diaeresis => e */
  996. 105, /* 236 14/12 G1 i grave => i */
  997. 105, /* 237 14/13 G1 i acute => i */
  998. 105, /* 238 14/14 G1 i circumflex => i */
  999. 105, /* 239 14/15 G1 i diaeresis => i */
  1000. 100, /* 240 15/00 G1 Icelandic eth => d */
  1001. 110, /* 241 15/01 G1 n tilde => n */
  1002. 111, /* 242 15/02 G1 o grave => o */
  1003. 111, /* 243 15/03 G1 o acute => o */
  1004. 111, /* 244 15/04 G1 o circumflex => o */
  1005. 111, /* 245 15/05 G1 o tilde => o */
  1006. 111, /* 246 15/06 G1 o diaeresis => o */
  1007. 47, /* 247 15/07 G1 Division sign => / */
  1008. 111, /* 248 15/08 G1 o oblique stroke => o */
  1009. 117, /* 249 15/09 G1 u grave => u */
  1010. 117, /* 250 15/10 G1 u acute => u */
  1011. 117, /* 251 15/11 G1 u circumflex => u */
  1012. 117, /* 252 15/12 G1 u diaeresis => u */
  1013. 121, /* 253 15/13 G1 y acute => y */
  1014. 116, /* 254 15/14 G1 Icelandic thorn => t */
  1015. 121 /* 255 15/15 G1 y diaeresis => y */
  1016. };
  1017. /* Translation tables for ISO Latin Alphabet 1 to local file character sets */
  1018. /*
  1019. Most of the remaining tables are not annotated like the one above, because
  1020. the size of the resulting source file would be ridiculous. Each row in the
  1021. following tables corresponds to a column of ISO 8859-1.
  1022. */
  1023. CONST CHAR
  1024. yl185[] = { /* ISO 8859-1 Latin Alphabet 1 (Latin-1) to IBM Code Page 850 */
  1025. /*
  1026. This is based on IBM's official invertible translation. Reference: IBM
  1027. Character Data Representation Architecture (CDRA), Level 1, Registry,
  1028. SC09-1291-00 (1990), p.152. (Note: Latin-1 is IBM Code Page 00819.) Note:
  1029. IBM's bizarre rearrangement of C0 controls and DEL has been undone in this
  1030. table.
  1031. */
  1032. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1033. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1034. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1035. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1036. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1037. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1038. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1039. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1040. 186, 205, 201, 187, 200, 188, 204, 185, 203, 202, 206, 223, 220, 219, 254, 242,
  1041. 179, 196, 218, 191, 192, 217, 195, 180, 194, 193, 197, 176, 177, 178, 213, 159,
  1042. 255, 173, 189, 156, 207, 190, 221, 245, 249, 184, 166, 174, 170, 240, 169, 238,
  1043. 248, 241, 253, 252, 239, 230, 244, 250, 247, 251, 167, 175, 172, 171, 243, 168,
  1044. 183, 181, 182, 199, 142, 143, 146, 128, 212, 144, 210, 211, 222, 214, 215, 216,
  1045. 209, 165, 227, 224, 226, 229, 153, 158, 157, 235, 233, 234, 154, 237, 232, 225,
  1046. 133, 160, 131, 198, 132, 134, 145, 135, 138, 130, 136, 137, 141, 161, 140, 139,
  1047. 208, 164, 149, 162, 147, 228, 148, 246, 155, 151, 163, 150, 129, 236, 231, 152
  1048. };
  1049. CONST CHAR
  1050. y85l1[] = { /* IBM Code Page 850 to Latin-1 */
  1051. /*
  1052. This is from IBM CDRA page 153. It is the inverse of yl185[].
  1053. As of edit 183, this table is no longer pure CDRA. The translations
  1054. involving C0 controls and DEL have been removed.
  1055. */
  1056. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1057. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1058. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1059. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1060. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1061. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1062. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1063. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1064. 199, 252, 233, 226, 228, 224, 229, 231, 234, 235, 232, 239, 238, 236, 196, 197,
  1065. 201, 230, 198, 244, 246, 242, 251, 249, 255, 214, 220, 248, 163, 216, 215, 159,
  1066. 225, 237, 243, 250, 241, 209, 170, 186, 191, 174, 172, 189, 188, 161, 171, 187,
  1067. 155, 156, 157, 144, 151, 193, 194, 192, 169, 135, 128, 131, 133, 162, 165, 147,
  1068. 148, 153, 152, 150, 145, 154, 227, 195, 132, 130, 137, 136, 134, 129, 138, 164,
  1069. 240, 208, 202, 203, 200, 158, 205, 206, 207, 149, 146, 141, 140, 166, 204, 139,
  1070. 211, 223, 212, 210, 245, 213, 181, 254, 222, 218, 219, 217, 253, 221, 175, 180,
  1071. 173, 177, 143, 190, 182, 167, 247, 184, 176, 168, 183, 185, 179, 178, 142, 160
  1072. };
  1073. #ifdef COMMENT
  1074. CONST CHAR
  1075. yl1r8[] = { /* Latin-1 to Hewlett Packard Roman8 */
  1076. /* This is HP's official translation, straight from iconv */
  1077. /* It is NOT invertible. */
  1078. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1079. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1080. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1081. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1082. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1083. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1084. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1085. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1086. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1087. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1088. 160, 184, 191, 187, 186, 188, 124, 189, 171, 99, 249, 251, 126, 45, 82, 176,
  1089. 179, 254, 50, 51, 168, 243, 244, 242, 44, 49, 250, 253, 247, 248, 245, 185,
  1090. 161, 224, 162, 225, 216, 208, 211, 180, 163, 220, 164, 165, 230, 229, 166, 167,
  1091. 227, 182, 232, 231, 223, 233, 218, 120, 210, 173, 237, 174, 219, 177, 240, 222,
  1092. 200, 196, 192, 226, 204, 212, 215, 181, 201, 197, 193, 205, 217, 213, 209, 221,
  1093. 228, 183, 202, 198, 194, 234, 206, 47, 214, 203, 199, 195, 207, 178, 241, 239
  1094. };
  1095. CONST CHAR
  1096. yr8l1[] = { /* Hewlett Packard Roman8 to Latin-1 */
  1097. /* This is HP's official translation, straight from iconv */
  1098. /* It is NOT invertible. */
  1099. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1100. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1101. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1102. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1103. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1104. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1105. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1106. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1107. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1108. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1109. 160, 192, 194, 200, 202, 203, 206, 207, 180, 96, 94, 168, 126, 217, 219, 163,
  1110. 175, 221, 253, 176, 199, 231, 209, 241, 161, 191, 164, 163, 165, 167, 102, 162,
  1111. 226, 234, 244, 251, 225, 233, 243, 250, 224, 232, 242, 249, 228, 235, 246, 252,
  1112. 197, 238, 216, 198, 229, 237, 248, 230, 196, 236, 214, 220, 201, 239, 223, 212,
  1113. 193, 195, 227, 208, 240, 205, 204, 211, 210, 213, 245, 83, 115, 218, 89, 255,
  1114. 222, 254, 183, 181, 182, 190, 45, 188, 189, 170, 186, 171, 42, 187, 177, 160
  1115. };
  1116. #else /* !COMMENT */
  1117. /* This is an invertible mapping, approved by HP in January 1994. */
  1118. CONST CHAR
  1119. yl1r8[] = { /* ISO Latin-1 to HP Roman8, Invertible */
  1120. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1121. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1122. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1123. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1124. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1125. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1126. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1127. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1128. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1129. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1130. 160, 184, 191, 187, 186, 188, 169, 189, 171, 170, 249, 251, 172, 175, 190, 176,
  1131. 179, 254, 235, 236, 168, 243, 244, 242, 238, 246, 250, 253, 247, 248, 245, 185,
  1132. 161, 224, 162, 225, 216, 208, 211, 180, 163, 220, 164, 165, 230, 229, 166, 167,
  1133. 227, 182, 232, 231, 223, 233, 218, 252, 210, 173, 237, 174, 219, 177, 240, 222,
  1134. 200, 196, 192, 226, 204, 212, 215, 181, 201, 197, 193, 205, 217, 213, 209, 221,
  1135. 228, 183, 202, 198, 194, 234, 206, 255, 214, 203, 199, 195, 207, 178, 241, 239
  1136. };
  1137. CONST CHAR
  1138. yr8l1[] = { /* HP Roman8 to ISO Latin-1, Invertible */
  1139. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1140. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1141. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1142. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1143. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1144. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1145. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1146. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1147. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1148. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1149. 160, 192, 194, 200, 202, 203, 206, 207, 180, 166, 169, 168, 172, 217, 219, 173,
  1150. 175, 221, 253, 176, 199, 231, 209, 241, 161, 191, 164, 163, 165, 167, 174, 162,
  1151. 226, 234, 244, 251, 225, 233, 243, 250, 224, 232, 242, 249, 228, 235, 246, 252,
  1152. 197, 238, 216, 198, 229, 237, 248, 230, 196, 236, 214, 220, 201, 239, 223, 212,
  1153. 193, 195, 227, 208, 240, 205, 204, 211, 210, 213, 245, 178, 179, 218, 184, 255,
  1154. 222, 254, 183, 181, 182, 190, 185, 188, 189, 170, 186, 171, 215, 187, 177, 247
  1155. };
  1156. #endif /* COMMENT */
  1157. CONST CHAR
  1158. yl143[] = { /* Latin-1 to IBM Code Page 437 */
  1159. /*
  1160. Although the IBM CDRA does not include an official translation between CP437
  1161. and ISO Latin Alphabet 1, it does include an official, invertible
  1162. translation between CP437 and CP850 (page 196), and another from CP850 to
  1163. Latin-1 (CP819) (page 153). This translation was obtained with a two-step
  1164. process based on those tables.
  1165. As of edit 183, the translation is modified to leave C0 controls alone.
  1166. */
  1167. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1168. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1169. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1170. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1171. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1172. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1173. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1174. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1175. 186, 205, 201, 187, 200, 188, 204, 185, 203, 202, 206, 223, 220, 219, 254, 242,
  1176. 179, 196, 218, 191, 192, 217, 195, 180, 194, 193, 197, 176, 177, 178, 213, 159,
  1177. 255, 173, 155, 156, 207, 157, 221, 245, 249, 184, 166, 174, 170, 240, 169, 238,
  1178. 248, 241, 253, 252, 239, 230, 244, 250, 247, 251, 167, 175, 172, 171, 243, 168,
  1179. 183, 181, 182, 199, 142, 143, 146, 128, 212, 144, 210, 211, 222, 214, 215, 216,
  1180. 209, 165, 227, 224, 226, 229, 153, 158, 190, 235, 233, 234, 154, 237, 232, 225,
  1181. 133, 160, 131, 198, 132, 134, 145, 135, 138, 130, 136, 137, 141, 161, 140, 139,
  1182. 208, 164, 149, 162, 147, 228, 148, 246, 189, 151, 163, 150, 129, 236, 231, 152
  1183. };
  1184. CONST CHAR
  1185. y43l1[] = { /* IBM Code Page 437 to Latin-1 */
  1186. /*
  1187. This table is the inverse of yl143[].
  1188. */
  1189. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1190. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1191. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1192. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1193. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1194. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1195. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1196. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1197. 199, 252, 233, 226, 228, 224, 229, 231, 234, 235, 232, 239, 238, 236, 196, 197,
  1198. 201, 230, 198, 244, 246, 242, 251, 249, 255, 214, 220, 162, 163, 165, 215, 159,
  1199. 225, 237, 243, 250, 241, 209, 170, 186, 191, 174, 172, 189, 188, 161, 171, 187,
  1200. 155, 156, 157, 144, 151, 193, 194, 192, 169, 135, 128, 131, 133, 248, 216, 147,
  1201. 148, 153, 152, 150, 145, 154, 227, 195, 132, 130, 137, 136, 134, 129, 138, 164,
  1202. 240, 208, 202, 203, 200, 158, 205, 206, 207, 149, 146, 141, 140, 166, 204, 139,
  1203. 211, 223, 212, 210, 245, 213, 181, 254, 222, 218, 219, 217, 253, 221, 175, 180,
  1204. 173, 177, 143, 190, 182, 167, 247, 184, 176, 168, 183, 185, 179, 178, 142, 160
  1205. };
  1206. CONST CHAR
  1207. yl1aq[] = { /* Latin-1 to Extended Mac Latin (based on Apple QuickDraw) */
  1208. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1209. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1210. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1211. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1212. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1213. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1214. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1215. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1216. 182, 183, 184, 185, 189, 196, 197, 198, 206, 207, 210, 211, 217, 218, 195, 212,
  1217. 209, 215, 213, 226, 227, 228, 240, 245, 246, 247, 249, 250, 251, 253, 254, 255,
  1218. 202, 193, 162, 163, 219, 180, 201, 164, 172, 169, 187, 199, 194, 208, 168, 248,
  1219. 161, 177, 170, 173, 171, 181, 166, 225, 252, 176, 188, 200, 178, 179, 186, 192,
  1220. 203, 231, 229, 204, 128, 129, 174, 130, 233, 131, 230, 232, 237, 234, 235, 236,
  1221. 220, 132, 241, 238, 239, 205, 133, 165, 175, 244, 242, 243, 134, 160, 222, 167,
  1222. 136, 135, 137, 139, 138, 140, 190, 141, 143, 142, 144, 145, 147, 146, 148, 149,
  1223. 221, 150, 152, 151, 153, 155, 154, 214, 191, 157, 156, 158, 159, 224, 223, 216
  1224. };
  1225. CONST CHAR
  1226. yl1du[] = { /* Latin-1 to Dutch ISO 646 */
  1227. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1228. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1229. 32, 33, 34, UNK, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1230. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1231. UNK, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1232. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, UNK, UNK, UNK, 94, 95,
  1233. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1234. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, 39, 127,
  1235. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1236. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1237. 32, 33, UNK, 35, 124, UNK, UNK, 93, 123, 67, UNK, 34, UNK, 45, 82, UNK,
  1238. 91, UNK, UNK, UNK, 126, 117, UNK, UNK, 44, UNK, UNK, 34, 125, 92, 64, 63,
  1239. 65, 65, 65, 65, 91, 65, 65, 67, 69, 69, 69, 69, 73, 73, 73, 73,
  1240. UNK, 78, 79, 79, 79, 79, 79, 120, 79, 85, 85, 85, 85, 89, UNK, 115,
  1241. 97, 97, 97, 97, 97, 97, 97, 99, 101, 101, 101, 101, 105, 105, 105, 105,
  1242. UNK, 110, 111, 111, 111, 111, 111, 47, 111, 117, 117, 117, 117, 121, UNK, 91
  1243. };
  1244. CONST CHAR
  1245. yl1fi[] = { /* Latin-1 to Finnish ISO NRC (*not* ISO 646) */
  1246. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1247. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1248. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1249. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1250. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1251. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, UNK, UNK, UNK, UNK, 95,
  1252. UNK, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1253. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1254. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1255. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1256. 32, 33, UNK, UNK, UNK, UNK, UNK, UNK, 34, 67, UNK, 34, UNK, 45, 82, UNK,
  1257. UNK, UNK, UNK, UNK, 39, 117, UNK, UNK, 44, UNK, UNK, 34, UNK, UNK, UNK, 63,
  1258. 65, 65, 65, 65, 91, 93, 65, 67, 69, 69, 69, 69, 73, 73, 73, 73,
  1259. UNK, 78, 79, 79, 79, 79, 92, 120, 79, 85, 85, 85, 94, 89, UNK, 115,
  1260. 97, 97, 97, 97, 123, 125, 97, 99, 101, 96, 101, 101, 105, 105, 105, 105,
  1261. UNK, 110, 111, 111, 111, 111, 124, 47, 111, 117, 117, 117, 126, 121, UNK, 121
  1262. };
  1263. CONST CHAR
  1264. yl1fr[] = { /* Latin-1 to French ISO 646 */
  1265. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1266. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1267. 32, 33, 34, UNK, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1268. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1269. UNK, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1270. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, UNK, UNK, UNK, 94, 95,
  1271. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1272. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1273. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1274. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1275. 32, 33, UNK, 35, UNK, UNK, UNK, 93, 34, 67, UNK, 34, UNK, 45, 82, UNK,
  1276. 91, UNK, UNK, UNK, 39, 117, UNK, UNK, 44, UNK, UNK, 34, UNK, UNK, UNK, 63,
  1277. 65, 65, 65, 65, 65, 65, 65, 67, 69, 69, 69, 69, 73, 73, 73, 73,
  1278. UNK, 78, 79, 79, 79, 79, 79, 120, 79, 85, 85, 85, 85, 89, UNK, 115,
  1279. 64, 97, 97, 97, 97, 97, 97, 92, 125, 123, 101, 101, 105, 105, 105, 105,
  1280. UNK, 110, 111, 111, 111, 111, 111, 47, 111, 124, 117, 117, 117, 121, UNK, 121
  1281. };
  1282. CONST CHAR
  1283. yl1fc[] = { /* Latin-1 to French-Canadian ISO 646 */
  1284. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1285. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1286. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1287. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1288. UNK, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1289. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, UNK, UNK, UNK, UNK, 95,
  1290. UNK, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1291. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1292. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1293. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1294. 32, 33, UNK, UNK, UNK, UNK, UNK, UNK, 34, 67, UNK, 34, UNK, 45, 82, UNK,
  1295. UNK, UNK, UNK, UNK, 39, 117, UNK, UNK, 44, UNK, UNK, 34, UNK, UNK, UNK, 63,
  1296. 65, 65, 65, 65, 65, 65, 65, 67, 69, 69, 69, 69, 73, 73, 73, 73,
  1297. UNK, 78, 79, 79, 79, 79, 79, 120, 79, 85, 85, 85, 85, 89, UNK, 115,
  1298. 64, 97, 91, 97, 97, 97, 97, 92, 125, 123, 93, 101, 105, 105, 94, 105,
  1299. UNK, 110, 111, 111, 96, 111, 111, 47, 111, 124, 117, 126, 117, 121, UNK, 121
  1300. };
  1301. CONST CHAR
  1302. yl1ge[] = { /* Latin-1 to German ISO 646 */
  1303. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1304. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1305. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1306. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1307. UNK, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1308. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, UNK, UNK, UNK, 94, 95,
  1309. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1310. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1311. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1312. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1313. 32, 33, UNK, UNK, UNK, UNK, UNK, 64, 34, 67, UNK, 34, UNK, 45, 82, UNK,
  1314. UNK, UNK, UNK, UNK, 39, 117, UNK, UNK, 44, UNK, UNK, 34, UNK, UNK, UNK, 63,
  1315. 65, 65, 65, 65, 91, 65, 65, 67, 69, 69, 69, 69, 73, 73, 73, 73,
  1316. UNK, 78, 79, 79, 79, 79, 92, 120, 79, 85, 85, 85, 93, 89, UNK, 126,
  1317. 97, 97, 97, 97, 123, 97, 97, 99, 101, 101, 101, 101, 105, 105, 105, 105,
  1318. UNK, 110, 111, 111, 111, 111, 124, 47, 111, 117, 117, 117, 125, 121, UNK, 121
  1319. };
  1320. CONST CHAR
  1321. yl1hu[] = { /* Latin-1 to Hungarian ISO-646 */
  1322. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1323. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1324. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1325. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1326. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1327. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1328. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1329. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1330. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1331. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1332. 32, 33, UNK, UNK, 36, UNK, UNK, UNK, 34, 67, UNK, 34, UNK, 45, 82, UNK,
  1333. UNK, 64, UNK, UNK, 39, 117, UNK, UNK, 44, UNK, UNK, 34, UNK, UNK, UNK, 63,
  1334. 65, 65, 65, 65, 65, 65, 65, 67, 69, 91, 69, 69, 73, 73, 73, 73,
  1335. UNK, 78, 79, 79, 79, 79, 92, 120, 79, 85, 85, 85, 93, 89, UNK, 115,
  1336. 97, 96, 97, 97, 97, 97, 97, 99, 101, 123, 101, 101, 105, 105, 105, 105,
  1337. UNK, 110, 111, 111, 111, 111, 124, 47, 111, 117, 117, 117, 125, 121, UNK, 121
  1338. };
  1339. CONST CHAR
  1340. yl1it[] = { /* Latin-1 to Italian ISO 646 */
  1341. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1342. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1343. 32, 33, 34, UNK, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1344. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1345. UNK, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1346. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, UNK, UNK, UNK, 94, 95,
  1347. UNK, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1348. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1349. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1350. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1351. 32, 33, UNK, 35, UNK, UNK, UNK, 64, 34, 67, UNK, 34, UNK, 45, 82, UNK,
  1352. 91, UNK, UNK, UNK, 39, 117, UNK, UNK, 44, UNK, UNK, 34, UNK, UNK, UNK, 63,
  1353. 65, 65, 65, 65, 65, 65, 65, 67, 69, 69, 69, 69, 73, 73, 73, 73,
  1354. UNK, 78, 79, 79, 79, 79, 79, 120, 79, 85, 85, 85, 85, 89, UNK, 115,
  1355. 123, 97, 97, 97, 97, 97, 97, 92, 125, 93, 101, 101, 126, 105, 105, 105,
  1356. UNK, 110, 124, 111, 111, 111, 111, 47, 111, 96, 117, 117, 117, 121, UNK, 121
  1357. };
  1358. CONST CHAR
  1359. yl1ne[] = { /* Latin-1 to NeXT */
  1360. /* NEED TO MAKE THIS ONE INVERTIBLE, LIKE CP850 */
  1361. /*
  1362. Which means finding all the graphic characters in the NeXT set that have
  1363. no equivalent in Latin-1 and assigning them to the UNK positions (mostly
  1364. Latin-1 C1 controls). Then make the ynel1[] table be the inverse of this
  1365. one. But first we should try to get an official Latin-1/NeXT translation
  1366. table from NeXT, Inc.
  1367. */
  1368. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1369. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1370. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1371. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1372. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1373. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1374. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1375. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1376. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1377. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1378. 32, 161, 162, 163, 168, 165, 181, 167, 200, 160, 227, 171, 190, UNK, 176, 197,
  1379. 202, 209, 201, 204, 194, 157, 182, 183, 203, 192, 235, 187, 210, 211, 212, 191,
  1380. 129, 130, 131, 132, 133, 134, 225, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1381. 144, 145, 146, 147, 148, 149, 150, 158, 233, 151, 152, 153, 154, 155, 156, 251,
  1382. 213, 214, 215, 216, 217, 218, 241, 219, 220, 221, 222, 223, 224, 226, 228, 229,
  1383. 230, 231, 236, 237, 238, 239, 240, 159, 249, 242, 243, 244, 246, 247, 252, 253
  1384. };
  1385. CONST CHAR
  1386. yl1no[] = { /* Latin-1 to Norwegian/Danish ISO 646 */
  1387. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1388. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1389. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1390. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1391. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1392. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, UNK, UNK, UNK, 94, 95,
  1393. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1394. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, 126, 127,
  1395. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1396. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1397. 32, 33, UNK, UNK, UNK, UNK, UNK, UNK, 34, 67, UNK, 34, UNK, 45, 82, UNK,
  1398. UNK, UNK, UNK, UNK, 39, 117, UNK, UNK, 44, UNK, UNK, 34, UNK, UNK, UNK, 63,
  1399. 65, 65, 65, 65, 65, 93, 91, 67, 69, 69, 69, 69, 73, 73, 73, 73,
  1400. UNK, 78, 79, 79, 79, 79, 79, 120, 92, 85, 85, 85, 85, 89, UNK, 115,
  1401. 97, 97, 97, 97, 97, 125, 123, 99, 101, 101, 101, 101, 105, 105, 105, 105,
  1402. UNK, 110, 111, 111, 111, 111, 111, 47, 124, 117, 117, 117, 117, 121, UNK, 121
  1403. };
  1404. CONST CHAR
  1405. yl1po[] = { /* Latin-1 to Portuguese ISO 646 */
  1406. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1407. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1408. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1409. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1410. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1411. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, UNK, UNK, UNK, 94, 95,
  1412. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1413. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, 126, 127,
  1414. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1415. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1416. 32, 33, UNK, UNK, UNK, UNK, UNK, UNK, 34, 67, UNK, 34, UNK, 45, 82, UNK,
  1417. UNK, UNK, UNK, UNK, 39, 117, UNK, UNK, 44, UNK, UNK, 34, UNK, UNK, UNK, 63,
  1418. 65, 65, 65, 91, 65, 65, 65, 92, 69, 69, 69, 69, 73, 73, 73, 73,
  1419. UNK, 78, 79, 79, 79, 93, 79, 120, 79, 85, 85, 85, 85, 89, UNK, 115,
  1420. 97, 97, 97, 123, 97, 97, 97, 124, 101, 101, 101, 101, 105, 105, 105, 105,
  1421. UNK, 110, 111, 111, 111, 125, 111, 47, 111, 117, 117, 117, 117, 121, UNK, 121
  1422. };
  1423. CONST CHAR
  1424. yl1sp[] = { /* Latin-1 to Spanish ISO 646 */
  1425. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1426. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1427. 32, 33, 34, UNK, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1428. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1429. UNK, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1430. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, UNK, UNK, UNK, 94, 95,
  1431. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1432. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 96, UNK, UNK, 126, 127,
  1433. 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1434. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1435. 32, 91, UNK, 35, UNK, UNK, UNK, 64, 34, 67, UNK, 34, UNK, 45, 82, UNK,
  1436. 123, UNK, UNK, UNK, 39, 117, UNK, UNK, 44, UNK, UNK, 34, UNK, UNK, UNK, 93,
  1437. 65, 65, 65, 65, 65, 65, 65, 67, 69, 69, 69, 69, 73, 73, 73, 73,
  1438. UNK, 92, 79, 79, 79, 79, 79, 120, 79, 85, 85, 85, 85, 89, UNK, 115,
  1439. 124, 97, 97, 97, 97, 97, 97, 125, 101, 101, 101, 101, 105, 105, 105, 105,
  1440. UNK, 124, 111, 111, 111, 111, 111, 47, 111, 117, 117, 117, 117, 121, UNK, 121
  1441. };
  1442. CONST CHAR
  1443. yl1sw[] = { /* Latin-1 to Swedish ISO 646 */
  1444. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1445. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1446. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1447. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1448. UNK, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1449. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, UNK, UNK, UNK, UNK, 95,
  1450. UNK, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1451. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1452. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1453. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1454. 32, 33, UNK, UNK, UNK, UNK, UNK, UNK, 34, 67, UNK, 34, UNK, 45, 82, UNK,
  1455. UNK, UNK, UNK, UNK, 39, 117, UNK, UNK, 44, UNK, UNK, 34, UNK, UNK, UNK, 63,
  1456. 65, 65, 65, 65, 91, 93, 65, 67, 69, 64, 69, 69, 73, 73, 73, 73,
  1457. UNK, 78, 79, 79, 79, 79, 92, 120, 79, 85, 85, 85, 94, 89, UNK, 115,
  1458. 97, 97, 97, 97, 123, 125, 97, 99, 101, 96, 101, 101, 105, 105, 105, 105,
  1459. UNK, 110, 111, 111, 111, 111, 124, 47, 111, 117, 117, 117, 126, 121, UNK, 121
  1460. };
  1461. CONST CHAR
  1462. yl1ch[] = { /* Latin-1 to Swiss ISO 646 */
  1463. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1464. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1465. 32, 33, 34, UNK, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1466. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1467. UNK, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1468. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, UNK, UNK, UNK, UNK, UNK,
  1469. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1470. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1471. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1472. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1473. 32, 33, UNK, UNK, UNK, UNK, UNK, UNK, 34, 67, UNK, 34, UNK, 45, 82, UNK,
  1474. UNK, UNK, UNK, UNK, 39, 117, UNK, UNK, 44, UNK, UNK, 34, UNK, UNK, UNK, 63,
  1475. 65, 65, 65, 65, 65, 65, 65, 67, 69, 69, 69, 69, 73, 73, 73, 73,
  1476. UNK, 78, 79, 79, 79, 79, 79, 120, 79, 85, 85, 85, 85, 89, UNK, 115,
  1477. 64, 97, 97, 97, 123, 97, 97, 92, 95, 91, 93, 101, 105, 105, 94, 105,
  1478. UNK, 110, 111, 111, 96, 111, 124, 47, 111, 35, 117, 126, 125, 121, UNK, 121
  1479. };
  1480. CONST CHAR
  1481. yl1dm[] = { /* Latin-1 to DEC Multinational Character Set */
  1482. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1483. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1484. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1485. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1486. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1487. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1488. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1489. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1490. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1491. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1492. 32, 161, 162, 163, 168, 165, 124, 167, 34, 169, 170, 171, 126, UNK, 82, UNK,
  1493. 176, 177, 178, 179, 39, 181, 182, 183, 44, 185, 186, 187, 188, 189, UNK, 191,
  1494. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1495. UNK, 209, 210, 211, 212, 213, 214, 120, 216, 217, 218, 219, 220, 221, UNK, 223,
  1496. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1497. UNK, 241, 242, 243, 244, 245, 246, 47, 248, 249, 250, 251, 252, UNK, UNK, 253
  1498. };
  1499. CONST CHAR
  1500. yl1dg[] = { /* Latin-1 to Data General International Character Set */
  1501. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1502. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1503. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1504. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1505. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1506. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1507. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1508. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1509. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1510. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1511. 160, 171, 167, 168, 166, 181, 191, 187, 189, 173, 169, 177, 161, 255, 174, 175,
  1512. 188, 182, 164, 165, 190, 163, 178, 185, 186, 179, 170, 176, 223, 162, 220, 172,
  1513. 193, 192, 194, 196, 195, 197, 198, 199, 201, 200, 202, 203, 205, 204, 206, 207,
  1514. 184, 208, 210, 209, 211, 213, 212, 215, 214, 217, 216, 218, 219, 221, 222, 252,
  1515. 225, 224, 226, 228, 227, 229, 230, 231, 233, 232, 234, 235, 237, 236, 238, 239,
  1516. 183, 240, 242, 241, 243, 245, 244, 247, 246, 249, 248, 250, 251, 180, 254, 253
  1517. };
  1518. /* Local file character sets to ISO Latin Alphabet 1 */
  1519. #ifdef NOTUSED
  1520. CONST CHAR
  1521. yasl1[] = { /* ASCII to Latin-1 */
  1522. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1523. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1524. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1525. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1526. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1527. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1528. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1529. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127
  1530. };
  1531. #endif /* NOTUSED */
  1532. CONST CHAR
  1533. yaql1[] = { /* Extended Mac Latin (based on Apple Quickdraw) to Latin-1 */
  1534. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1535. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1536. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1537. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1538. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1539. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1540. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1541. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1542. 196, 197, 199, 201, 209, 214, 220, 225, 224, 226, 228, 227, 229, 231, 233, 232,
  1543. 234, 235, 237, 236, 238, 239, 241, 243, 242, 244, 246, 245, 250, 249, 251, 252,
  1544. 221, 176, 162, 163, 167, 215, 182, 223, 174, 169, 178, 180, 168, 179, 198, 216,
  1545. 185, 177, 188, 189, 165, 181, 128, 129, 130, 131, 190, 170, 186, 132, 230, 248,
  1546. 191, 161, 172, 142, 133, 134, 135, 171, 187, 166, 160, 192, 195, 213, 136, 137,
  1547. 173, 144, 138, 139, 143, 146, 247, 145, 255, 140, 141, 164, 208, 240, 222, 254,
  1548. 253, 183, 147, 148, 149, 194, 202, 193, 203, 200, 205, 206, 207, 204, 211, 212,
  1549. 150, 210, 218, 219, 217, 151, 152, 153, 175, 154, 155, 156, 184, 157, 158, 159
  1550. };
  1551. CONST CHAR
  1552. ydul1[] = { /* Dutch ISO 646 to Latin-1 */
  1553. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1554. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1555. 32, 33, 34, 163, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1556. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1557. 190, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1558. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 255, 189, 124, 94, 95,
  1559. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1560. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 168, 164, 188, 39, 127
  1561. };
  1562. CONST CHAR
  1563. yfil1[] = { /* Finnish NRC (*not* ISO-646) to Latin-1 */
  1564. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1565. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1566. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1567. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1568. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1569. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 196, 214, 197, 220, 95,
  1570. 233, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1571. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 229, 252, 127
  1572. };
  1573. CONST CHAR
  1574. yfrl1[] = { /* French ISO 646 to Latin-1 */
  1575. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1576. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1577. 32, 33, 34, 163, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1578. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1579. 224, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1580. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 176, 231, 167, 94, 95,
  1581. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1582. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 249, 232, 168, 127
  1583. };
  1584. CONST CHAR
  1585. yfcl1[] = { /* French-Canadian ISO 646 to Latin-1 */
  1586. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1587. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1588. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1589. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1590. 224, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1591. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 226, 231, 234, 238, 95,
  1592. 244, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1593. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 249, 232, 251, 127
  1594. };
  1595. CONST CHAR
  1596. ygel1[] = { /* German ISO 646 to Latin-1 */
  1597. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1598. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1599. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1600. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1601. 167, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1602. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 196, 214, 220, 94, 95,
  1603. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1604. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 252, 223, 127
  1605. };
  1606. CONST CHAR
  1607. yitl1[] = { /* Italian ISO 646 to Latin-1 */
  1608. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1609. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1610. 32, 33, 34, 163, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1611. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1612. 167, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1613. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 176, 231, 233, 94, 95,
  1614. 249, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1615. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 224, 242, 232, 236, 127
  1616. };
  1617. CONST CHAR
  1618. ynel1[] = { /* NeXT to Latin-1 */
  1619. /* NEED TO MAKE THIS ONE INVERTIBLE */
  1620. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1621. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1622. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1623. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1624. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1625. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1626. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1627. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1628. 160, 192, 193, 194, 195, 196, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1629. 208, 209, 210, 211, 212, 213, 214, 217, 218, 219, 220, 221, 222, 181, 215, 247,
  1630. 169, 161, 162, 163, UNK, 165, UNK, 167, 164, UNK, UNK, 171, UNK, UNK, UNK, UNK,
  1631. 174, UNK, UNK, UNK, 183, 166, 182, UNK, UNK, UNK, UNK, 187, UNK, UNK, 172, 191,
  1632. 185, 96, 180, 94, 126, 175, UNK, UNK, 168, 178, 176, 184, 179, UNK, UNK, UNK,
  1633. UNK, 177, 188, 189, 190, 224, 225, 226, 227, 228, 229, 231, 232, 233, 234, 235,
  1634. 236, 198, 237, 170, 238, 239, 240, 241, UNK, 216, UNK, 186, 242, 243, 244, 245,
  1635. 246, 230, 249, 250, 251, UNK, 252, 253, UNK, 248, UNK, 223, 254, 255, UNK, UNK
  1636. };
  1637. CONST CHAR
  1638. ynol1[] = { /* Norwegian/Danish ISO 646 to Latin-1 */
  1639. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1640. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1641. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1642. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1643. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1644. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 198, 216, 197, 94, 95,
  1645. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1646. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 230, 248, 229, 126, 127
  1647. };
  1648. CONST CHAR
  1649. ypol1[] = { /* Portuguese ISO 646 to Latin-1 */
  1650. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1651. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1652. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1653. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1654. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1655. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 195, 199, 213, 94, 95,
  1656. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1657. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 227, 231, 245, 126, 127
  1658. };
  1659. CONST CHAR
  1660. yspl1[] = { /* Spanish ISO 646 to Latin-1 */
  1661. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1662. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1663. 32, 33, 34, 163, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1664. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1665. 167, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1666. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 161, 209, 191, 94, 95,
  1667. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1668. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 176, 241, 231, 126, 127
  1669. };
  1670. CONST CHAR
  1671. yswl1[] = { /* Swedish ISO 646 to Latin-1 */
  1672. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1673. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1674. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1675. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1676. 201, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1677. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 196, 214, 197, 220, 95,
  1678. 233, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1679. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 229, 252, 127
  1680. };
  1681. CONST CHAR
  1682. ychl1[] = { /* Swiss ISO 646 to Latin-1 */
  1683. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1684. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1685. 32, 33, 34, 249, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1686. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1687. 224, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1688. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 233, 231, 234, 238, 232,
  1689. 244, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1690. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 252, 251, 127
  1691. };
  1692. CONST CHAR
  1693. yhul1[] = { /* Hungarian ISO 646 to Latin-1 */
  1694. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1695. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1696. 32, 33, 34, 35, 164, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1697. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1698. 193, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1699. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 201, 214, 220, 94, 95,
  1700. 225, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1701. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 246, 252, 34, 127
  1702. };
  1703. CONST CHAR
  1704. ydml1[] = { /* DEC Multinational Character Set to Latin-1 */
  1705. /* Note: This is a null translation */
  1706. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1707. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1708. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1709. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1710. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1711. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1712. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1713. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1714. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1715. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1716. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1717. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1718. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1719. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1720. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1721. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
  1722. };
  1723. CONST CHAR
  1724. ydgl1[] = { /* Data General International to Latin-1 */
  1725. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1726. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1727. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1728. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1729. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1730. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1731. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1732. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1733. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1734. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1735. 160, 172, 189, 181, 178, 179, 164, 162, 163, 170, 186, 161, 191, 169, 174, 175,
  1736. 187, 171, 182, 185, 253, 165, 177, 240, 208, 183, 184, 167, 176, 168, 180, 166,
  1737. 193, 192, 194, 196, 195, 197, 198, 199, 201, 200, 202, 203, 205, 204, 206, 207,
  1738. 209, 211, 210, 212, 214, 213, 216, 215, 218, 217, 219, 220, 190, 221, 222, 188,
  1739. 225, 224, 226, 228, 227, 229, 230, 231, 233, 232, 234, 235, 237, 236, 238, 239,
  1740. 241, 243, 242, 244, 246, 245, 248, 247, 250, 249, 251, 252, 223, 255, 254, 173
  1741. };
  1742. /* Translation tables for Cyrillic character sets */
  1743. #ifdef CYRILLIC
  1744. CONST CHAR
  1745. ylcac[] = { /* Latin/Cyrillic to CP866 */
  1746. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1747. 16, 17, 18, 19, 208, 209, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1748. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1749. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1750. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1751. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1752. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1753. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1754. 196, 179, 192, 217, 191, 218, 195, 193, 180, 194, 197, 176, 177, 178, 211, 216,
  1755. 205, 186, 200, 188, 187, 201, 204, 202, 185, 203, 206, 223, 220, 219, 254, UNK,
  1756. 255, 240, 132, 131, 242, 83, 73, 244, 74, 139, 141, 151, 138, 45, 246, 135,
  1757. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1758. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1759. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1760. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1761. 252, 241, 164, 163, 243, 115, 105, 245, 106, 171, 173, 231, 170, 21, 247, 167
  1762. };
  1763. CONST CHAR
  1764. ylc55[] = { /* Latin/Cyrillic to CP855 (inverse of y55lc) */
  1765. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1766. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1767. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1768. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1769. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1770. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1771. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1772. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1773. 174, 175, 176, 177, 178, 179, 180, 185, 186, 187, 188, 191, 192, 193, 194, 195,
  1774. 196, 197, 200, 201, 202, 203, 204, 205, 206, 207, 217, 218, 219, 220, 223, 254,
  1775. 255, 133, 129, 131, 135, 137, 139, 141, 143, 145, 147, 149, 151, 240, 153, 155,
  1776. 161, 163, 236, 173, 167, 169, 234, 244, 184, 190, 199, 209, 211, 213, 215, 221,
  1777. 226, 228, 230, 232, 171, 182, 165, 252, 246, 250, 159, 242, 238, 248, 157, 224,
  1778. 160, 162, 235, 172, 166, 168, 233, 243, 183, 189, 198, 208, 210, 212, 214, 216,
  1779. 225, 227, 229, 231, 170, 181, 164, 251, 245, 249, 158, 241, 237, 247, 156, 222,
  1780. 239, 132, 128, 130, 134, 136, 138, 140, 142, 144, 146, 148, 150, 253, 152, 154
  1781. };
  1782. CONST CHAR
  1783. ylc1251[] = { /* Latin/Cyrillic to CP1251 (inverse of y1251lc) */
  1784. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1785. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1786. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1787. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1788. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1789. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1790. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1791. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1792. 130, 132, 133, 134, 135, 136, 137, 139, 145, 146, 147, 148, 149, 150, 151, 152,
  1793. 153, 155, 164, 165, 166, 169, 171, 172, 174, 176, 177, 180, 181, 182, 183, 187,
  1794. 160, 168, 128, 129, 170, 189, 178, 175, 163, 138, 140, 142, 141, 173, 161, 143,
  1795. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1796. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1797. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1798. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
  1799. 185, 184, 144, 131, 186, 190, 179, 191, 188, 154, 156, 158, 157, 167, 162, 159
  1800. };
  1801. CONST CHAR
  1802. ylcbu[] = { /* Latin/Cyrillic to Bulgarian PC Code Page */
  1803. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1804. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1805. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1806. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1807. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1808. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1809. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1810. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1811. 255, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
  1812. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1813. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1814. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1815. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1816. 213, 207, 208, 209, 210, 211, 212, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1817. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1818. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 214, 253, 254
  1819. };
  1820. CONST CHAR
  1821. ylck8[] = { /* Latin/Cyrillic to Old KOI-8 Cyrillic */
  1822. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1823. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1824. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1825. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1826. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1827. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1828. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1829. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1830. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1831. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1832. UNK, 229, UNK, UNK, UNK, 83, 73, 73, 74, UNK, UNK, UNK, 235, UNK, 245, UNK,
  1833. 225, 226, 247, 231, 228, 229, 246, 250, 233, 234, 235, 236, 237, 238, 239, 240,
  1834. 242, 243, 244, 245, 230, 232, 227, 254, 251, 253, 255, 249, 248, 252, 224, 241,
  1835. 193, 194, 215, 199, 196, 197, 214, 218, 201, 202, 203, 204, 205, 206, 207, 208,
  1836. 210, 211, 212, 213, 198, 200, 195, 222, 219, 221, 223, 217, 216, 220, 192, 209,
  1837. UNK, 197, UNK, UNK, UNK, 115, 105, 105, 106, UNK, UNK, UNK, 203, UNK, 213, UNK
  1838. };
  1839. CONST CHAR
  1840. yaclc[] = { /* CP866 to Latin/Cyrillic */
  1841. /* NEED TO MAKE THIS ONE INVERTIBLE */
  1842. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1843. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1844. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1845. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1846. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1847. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1848. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1849. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1850. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1851. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1852. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1853. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1854. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1855. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1856. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1857. 161, 241, 164, 244, 167, 247, 174, 254, UNK, UNK, UNK, UNK, 240, UNK, UNK, UNK
  1858. };
  1859. CONST CHAR
  1860. y55lc[] = { /* CP855 to Latin/Cyrillic (inverse of ylc55) */
  1861. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1862. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1863. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1864. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1865. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1866. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1867. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1868. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1869. 242, 162, 243, 163, 241, 161, 244, 164, 245, 165, 246, 166, 247, 167, 248, 168,
  1870. 249, 169, 250, 170, 251, 171, 252, 172, 254, 174, 255, 175, 238, 206, 234, 202,
  1871. 208, 176, 209, 177, 230, 198, 212, 180, 213, 181, 228, 196, 211, 179, 128, 129,
  1872. 130, 131, 132, 133, 134, 229, 197, 216, 184, 135, 136, 137, 138, 217, 185, 139,
  1873. 140, 141, 142, 143, 144, 145, 218, 186, 146, 147, 148, 149, 150, 151, 152, 153,
  1874. 219, 187, 220, 188, 221, 189, 222, 190, 223, 154, 155, 156, 157, 191, 239, 158,
  1875. 207, 224, 192, 225, 193, 226, 194, 227, 195, 214, 182, 210, 178, 236, 204, 240,
  1876. 173, 235, 203, 215, 183, 232, 200, 237, 205, 233, 201, 231, 199, 253, 159, 160
  1877. };
  1878. CONST CHAR
  1879. y1251lc[] = { /* CP1251 to Latin/Cyrillic (inverse of ylc1251) */
  1880. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1881. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1882. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1883. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1884. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1885. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1886. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1887. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1888. 162, 163, 128, 243, 129, 130, 131, 132, 133, 134, 169, 135, 170, 172, 171, 175,
  1889. 242, 136, 137, 138, 139, 140, 141, 142, 143, 144, 249, 145, 250, 252, 251, 255,
  1890. 160, 174, 254, 168, 146, 147, 148, 253, 161, 149, 164, 150, 151, 173, 152, 167,
  1891. 153, 154, 166, 246, 155, 156, 157, 158, 241, 240, 244, 159, 248, 165, 245, 247,
  1892. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1893. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1894. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1895. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239
  1896. };
  1897. CONST CHAR
  1898. ybulc[] = { /* Bulgarian PC Code Page to Latin/Cyrillic */
  1899. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1900. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1901. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1902. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1903. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1904. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1905. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1906. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1907. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1908. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1909. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1910. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1911. 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 209,
  1912. 210, 211, 212, 213, 214, 208, 253, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1913. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1914. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 254, 255, 128
  1915. };
  1916. CONST CHAR
  1917. yk8lc[] = { /* Old KOI-8 Cyrillic to Latin/Cyrillic */
  1918. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1919. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1920. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1921. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1922. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1923. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1924. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1925. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1926. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1927. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1928. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1929. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1930. 238, 208, 209, 230, 212, 213, 228, 211, 229, 216, 217, 218, 219, 220, 221, 222,
  1931. 223, 239, 224, 225, 226, 227, 214, 210, 236, 235, 215, 232, 237, 233, 231, 234,
  1932. 206, 176, 177, 198, 180, 181, 196, 179, 197, 184, 185, 186, 187, 188, 189, 190,
  1933. 191, 207, 192, 193, 194, 195, 182, 178, 204, 203, 183, 200, 205, 201, 199, 127
  1934. };
  1935. CONST CHAR
  1936. ylcsk[] = { /* Latin/Cyrillic to Short KOI */
  1937. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1938. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1939. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1940. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1941. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1942. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1943. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1944. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 127,
  1945. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1946. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1947. 32, 101, UNK, UNK, UNK, 83, 73, 73, 74, UNK, UNK, UNK, 107, 45, 117, UNK,
  1948. 97, 98, 119, 103, 100, 101, 118, 122, 105, 106, 107, 108, 109, 110, 111, 112,
  1949. 114, 115, 116, 117, 102, 104, 99, 126, 123, 125, 39, 121, 120, 124, 96, 113,
  1950. 97, 98, 119, 103, 100, 101, 118, 122, 105, 106, 107, 108, 109, 110, 111, 112,
  1951. 114, 115, 116, 117, 102, 104, 99, 126, 123, 125, 39, 121, 120, 124, 96, 113,
  1952. UNK, 101, UNK, UNK, UNK, 83, 73, 73, 74, UNK, UNK, UNK, 107, UNK, 117, UNK
  1953. };
  1954. CONST CHAR yskcy[] = { /* Short KOI to Latin/Cyrillic */
  1955. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1956. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1957. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1958. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1959. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1960. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1961. 206, 176, 177, 198, 180, 181, 196, 179, 197, 184, 185, 186, 187, 188, 189, 190,
  1962. 191, 207, 192, 193, 194, 195, 182, 178, 204, 203, 183, 200, 205, 201, 199, 127
  1963. };
  1964. #endif /* CYRILLIC */
  1965. #ifdef LATIN2
  1966. /* Latin-2 tables */
  1967. CONST CHAR
  1968. yl252[] = { /* Latin-2 to Code Page 852 */
  1969. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1970. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1971. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1972. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1973. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1974. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1975. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1976. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1977. 174, 175, 176, 177, 178, 179, 180, 185, 186, 187, 188, 191, 192, 193, 194, 195,
  1978. 196, 197, 200, 201, 202, 203, 204, 205, 206, 217, 218, 219, 220, 223, 240, 254,
  1979. 255, 164, 244, 157, 207, 149, 151, 245, 249, 230, 184, 155, 141, 170, 166, 189,
  1980. 248, 165, 242, 136, 239, 150, 152, 243, 247, 231, 173, 156, 171, 241, 167, 190,
  1981. 232, 181, 182, 198, 142, 145, 143, 128, 172, 144, 168, 211, 183, 214, 215, 210,
  1982. 209, 227, 213, 224, 226, 138, 153, 158, 252, 222, 233, 235, 154, 237, 221, 225,
  1983. 234, 160, 131, 199, 132, 146, 134, 135, 159, 130, 169, 137, 216, 161, 140, 212,
  1984. 208, 228, 229, 162, 147, 139, 148, 246, 253, 133, 163, 251, 129, 236, 238, 250
  1985. };
  1986. CONST CHAR
  1987. y52l2[] = { /* Code Page 852 to Latin-2 */
  1988. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1989. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1990. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1991. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  1992. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  1993. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  1994. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1995. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1996. 199, 252, 233, 226, 228, 249, 230, 231, 179, 235, 213, 245, 238, 172, 196, 198,
  1997. 201, 197, 229, 244, 246, 165, 181, 166, 182, 214, 220, 171, 187, 163, 215, 232,
  1998. 225, 237, 243, 250, 161, 177, 174, 190, 202, 234, 173, 188, 200, 186, 128, 129,
  1999. 130, 131, 132, 133, 134, 193, 194, 204, 170, 135, 136, 137, 138, 175, 191, 139,
  2000. 140, 141, 142, 143, 144, 145, 195, 227, 146, 147, 148, 149, 150, 151, 152, 164,
  2001. 240, 208, 207, 203, 239, 210, 205, 206, 236, 153, 154, 155, 156, 222, 217, 157,
  2002. 211, 223, 212, 209, 241, 242, 169, 185, 192, 218, 224, 219, 253, 221, 254, 180,
  2003. 158, 189, 178, 183, 162, 167, 247, 184, 176, 168, 255, 251, 216, 248, 159, 160
  2004. };
  2005. CONST CHAR
  2006. yl21250[] = { /* Latin-2 to Code Page 1250 */
  2007. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2008. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2009. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2010. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2011. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2012. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2013. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2014. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2015. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 139, 144, 145, 146, 147, 148,
  2016. 149, 150, 151, 152, 153, 155, 166, 169, 171, 172, 174, 177, 181, 182, 183, 187,
  2017. 160, 165, 162, 163, 164, 188, 140, 167, 168, 138, 170, 141, 143, 173, 142, 175,
  2018. 176, 185, 178, 179, 180, 190, 156, 161, 184, 154, 186, 157, 159, 189, 158, 191,
  2019. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  2020. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  2021. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  2022. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
  2023. };
  2024. CONST CHAR
  2025. y1250l2[] = { /* Code Page 1250 to Latin-2 */
  2026. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2027. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2028. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2029. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2030. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2031. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2032. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2033. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2034. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 169, 138, 166, 171, 174, 172,
  2035. 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 185, 149, 182, 187, 190, 188,
  2036. 160, 183, 162, 163, 164, 161, 150, 167, 168, 151, 170, 152, 153, 173, 154, 175,
  2037. 176, 155, 178, 179, 180, 156, 157, 158, 184, 177, 186, 159, 165, 189, 181, 191,
  2038. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  2039. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  2040. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  2041. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
  2042. };
  2043. CONST CHAR
  2044. yl2mz[] = { /* Latin-2 to Mazovia (NOT invertible) */
  2045. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2046. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2047. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2048. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2049. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2050. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2051. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2052. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2053. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  2054. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  2055. 255, 143, UNK, 156, 155, 76, 152, 21, 34, 83, 83, 84, 160, 45, 90, 161,
  2056. 248, 134, 44, 146, 39, 108, 158, UNK, 44, 115, 115, 116, 166, 34, 122, 167,
  2057. 82, 65, 65, 65, 142, 76, 149, 128, 67, 69, 144, 69, 69, 73, 73, 68,
  2058. 68, 165, 78, 163, 79, 153, 153, 250, 82, 85, 85, 154, 154, 89, 84, 225,
  2059. 114, 97, 131, 97, 132, 108, 141, 135, 99, 130, 145, 137, 101, 105, 140, 101,
  2060. 100, 164, 110, 162, 147, 148, 148, 246, 114, 117, 117, 129, 129, 121, 116, 249
  2061. };
  2062. CONST CHAR
  2063. ymzl2[] = { /* Mazovia to Latin-2 (NOT INVERTIBLE) */
  2064. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2065. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2066. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2067. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2068. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2069. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2070. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2071. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2072. 128, 252, 233, 226, 228, 97, 177, 231, 101, 235, 101, 105, 238, 230, 196, 161,
  2073. 202, 234, 179, 244, 246, 198, 117, 117, 166, 214, 220, 164, 163, 89, 182, 102,
  2074. 172, 175, 243, 211, 242, 210, 188, 191, 63, UNK, UNK, UNK, UNK, 33, 34, 34,
  2075. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2076. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2077. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2078. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2079. UNK, UNK, UNK, UNK, UNK, UNK, 247, UNK, 176, 255, 215, UNK, UNK, UNK, UNK, 160
  2080. };
  2081. CONST CHAR
  2082. yl2l1[] = { /* Latin-2 to Latin-1 */
  2083. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2084. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2085. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2086. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2087. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2088. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2089. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2090. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2091. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  2092. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  2093. 160, 'A', UNK, 'L', 164, 'L', 'S', 167, 168, 'S', 'S', 'T', 'Z', 173, 'Z', 'Z',
  2094. 176, 'a', UNK, 'l', 180, 'l', 's', UNK, 184, 's', 's', 't', 'z', UNK, 'z', 'z',
  2095. 'R', 193, 194, 'A', 196, 'L', 'C', 199, 'C', 201, 'E', 203, 'E', 205, 'I', 'D',
  2096. 208, 'N', 'N', 211, 212, 'O', 214, 215, 'R', 'U', 218, 'U', 220, 221, 'T', 223,
  2097. 'r', 225, 226, 'a', 228, 'l', 'c', 231, 'c', 233, 'e', 235, 'e', 237, 'i', 'd',
  2098. 240, 'n', 'n', 243, 244, 'o', 246, 247, 'r', 'u', 250, 'u', 252, 253, 't', '.'
  2099. };
  2100. CONST CHAR
  2101. yl1l2[] = { /* Latin-1 to Latin-2 */
  2102. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2103. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2104. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2105. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2106. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2107. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2108. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2109. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2110. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  2111. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  2112. 160, 'A', UNK, 'L', 164, UNK, UNK, 167, 168, 'C', 'a', '<', '>', 173, 'R', UNK,
  2113. 176, UNK, UNK, UNK, 180, UNK, UNK, UNK, 184, UNK, 'o', '>', UNK, UNK, UNK, UNK,
  2114. 'A', 193, 194, 'A', 196, 'A', 'A', 199, 'E', 201, 'E', 203, 'I', 205, 'I', 'I',
  2115. 208, 'N', 'O', 211, 212, 'O', 214, 215, 'O', 'U', 218, 'U', 220, 221, UNK, 223,
  2116. 'a', 225, 226, 'a', 228, 'a', 'a', 231, 'e', 233, 'e', 235, 'i', 237, 'i', 'i',
  2117. 240, 'n', 'o', 243, 244, 'o', 246, 247, 'o', 'u', 250, 'u', 252, 253, UNK, 'y'
  2118. };
  2119. CONST CHAR
  2120. yl2as[] = { /* Latin-2 to ASCII */
  2121. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2122. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2123. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2124. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2125. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2126. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2127. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2128. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2129. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2130. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2131. 32, 'A', UNK, 'L', UNK, 'L', 'S', UNK, 34, 'S', 'S', 'T', 'Z', '-', 'Z', 'Z',
  2132. UNK, 'a', UNK, 'l', 39, 'l', 's', UNK, 44, 's', 's', 't', 'z', UNK, 'z', 'z',
  2133. 'R', 'A', 'A', 'A', 'A', 'L', 'C', 'C', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'D',
  2134. 'D', 'N', 'N', 'O', 'O', 'O', 'O', 'x', 'R', 'U', 'U', 'U', 'U', 'Y', 'T', 's',
  2135. 'r', 'a', 'a', 'a', 'a', 'l', 'c', 'c', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'd',
  2136. 'd', 'n', 'n', 'o', 'o', 'o', 'o', '/', 'r', 'u', 'u', 'u', 'u', 'y', 't', '.'
  2137. };
  2138. #endif /* LATIN2 */
  2139. #ifdef HEBREW
  2140. /*
  2141. 8-bit Tables providing invertible translation between Latin/Hebrew and CP862.
  2142. */
  2143. CONST CHAR
  2144. y62lh[] = { /* PC Code Page 862 to ISO 8859-8 Latin/Hebrew */
  2145. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2146. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2147. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2148. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2149. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2150. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2151. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2152. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2153. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  2154. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 162, 163, 165, 128, 129,
  2155. 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 172, 189, 188, 140, 171, 187,
  2156. 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
  2157. 157, 158, 159, 161, 164, 166, 167, 168, 169, 170, 173, 174, 175, 223, 179, 180,
  2158. 182, 184, 185, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
  2159. 203, 204, 205, 206, 207, 208, 181, 209, 210, 211, 212, 213, 214, 215, 216, 217,
  2160. 218, 177, 219, 220, 221, 222, 186, 251, 176, 183, 252, 253, 254, 178, 255, 160
  2161. };
  2162. CONST CHAR
  2163. ylh62[] = { /* ISO 8859-8 Latin/Hebrew to PC Code Page 862 */
  2164. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2165. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2166. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2167. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2168. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2169. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2170. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2171. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2172. 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 173, 176, 177, 178,
  2173. 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
  2174. 255, 195, 155, 156, 196, 157, 197, 198, 199, 200, 201, 174, 170, 202, 203, 204,
  2175. 248, 241, 253, 206, 207, 230, 208, 249, 209, 210, 246, 175, 172, 171, 211, 212,
  2176. 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
  2177. 229, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 242, 243, 244, 245, 205,
  2178. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  2179. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 247, 250, 251, 252, 254
  2180. };
  2181. /*
  2182. 7-bit table providing readable translation from DEC Hebrew-7 to CP862.
  2183. */
  2184. CONST CHAR
  2185. yh762[] = {
  2186. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2187. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2188. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2189. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2190. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2191. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2192. UNK, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2193. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127
  2194. };
  2195. /*
  2196. 8-bit table providing readable translation from CP862 to Hebrew-7.
  2197. */
  2198. CONST CHAR
  2199. y62h7[] = { /* PC Code Page 862 to Hebrew-7 */
  2200. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2201. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2202. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2203. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2204. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2205. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2206. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2207. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127,
  2208. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2209. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, UNK,
  2210. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2211. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2212. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2213. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2214. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2215. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK
  2216. };
  2217. /*
  2218. 7-bit table providing readable translation from Hebrew-7 to ISO Latin/Hebrew.
  2219. */
  2220. CONST CHAR
  2221. yh7lh[] = {
  2222. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2223. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2224. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2225. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2226. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2227. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2228. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  2229. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 123, 124, 125, 126, 127
  2230. };
  2231. /*
  2232. 8-bit table providing readable translation from ISO Latin/Hebrew to Hebrew-7.
  2233. */
  2234. CONST CHAR
  2235. ylhh7[] = { /* Latin/Hebrew to Hebrew-7 */
  2236. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2237. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2238. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2239. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2240. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2241. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2242. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2243. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127,
  2244. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2245. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2246. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2247. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2248. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2249. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2250. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2251. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, UNK
  2252. };
  2253. #endif /* HEBREW */
  2254. #ifdef GREEK
  2255. /*
  2256. 8-bit Tables providing invertible translation between Latin/Greek and CP869.
  2257. */
  2258. CONST CHAR
  2259. ylg69[] = { /* ISO 8859-7 Latin/Greek to PC Code Page 869 */
  2260. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2261. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2262. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2263. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2264. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2265. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2266. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2267. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2268. 135, 147, 148, 176, 177, 178, 179, 180, 185, 186, 187, 188, 191, 192, 193, 194,
  2269. 195, 196, 197, 200, 201, 202, 203, 204, 205, 206, 217, 218, 219, 220, 223, 254,
  2270. 255, 139, 140, 156, 128, 129, 138, 245, 249, 151, 130, 174, 137, 240, 131, 142,
  2271. 248, 241, 153, 154, 239, 247, 134, 136, 141, 143, 144, 175, 146, 171, 149, 152,
  2272. 161, 164, 165, 166, 167, 168, 169, 170, 172, 173, 181, 182, 183, 184, 189, 190,
  2273. 198, 199, 132, 207, 208, 209, 210, 211, 212, 213, 145, 150, 155, 157, 158, 159,
  2274. 252, 214, 215, 216, 221, 222, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
  2275. 234, 235, 237, 236, 238, 242, 243, 244, 246, 250, 160, 251, 162, 163, 253, 133
  2276. };
  2277. CONST CHAR
  2278. y69lg[] = { /* PC Code Page 869 to ISO 8859-7 Latin/Greek */
  2279. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2280. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2281. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2282. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2283. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2284. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2285. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2286. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  2287. 164, 165, 170, 174, 210, 255, 182, 128, 183, 172, 166, 161, 162, 184, 175, 185,
  2288. 186, 218, 188, 129, 130, 190, 219, 169, 191, 178, 179, 220, 163, 221, 222, 223,
  2289. 250, 192, 252, 253, 193, 194, 195, 196, 197, 198, 199, 189, 200, 201, 171, 187,
  2290. 131, 132, 133, 134, 135, 202, 203, 204, 205, 136, 137, 138, 139, 206, 207, 140,
  2291. 141, 142, 143, 144, 145, 146, 208, 209, 147, 148, 149, 150, 151, 152, 153, 211,
  2292. 212, 213, 214, 215, 216, 217, 225, 226, 227, 154, 155, 156, 157, 228, 229, 158,
  2293. 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 243, 242, 244, 180,
  2294. 173, 177, 245, 246, 247, 167, 248, 181, 176, 168, 249, 251, 224, 254, 159, 160
  2295. };
  2296. /*
  2297. 7-bit table providing readable translation from ELOT 927 to CP869.
  2298. */
  2299. CONST CHAR
  2300. yeg69[] = {
  2301. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2302. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2303. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2304. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2305. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2306. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2307. 96, 164, 165, 166, 167, 168, 169, 170, 172, 173, 181, 182, 183, 184, 189, 190,
  2308. 198, 199, 207, 208, 209, 210, 211, 212, 213, 32, 32, 23, 124, 125, 126, 127
  2309. };
  2310. /*
  2311. 8-bit table providing readable translation from CP869 to ELOT 927.
  2312. */
  2313. CONST CHAR
  2314. y69eg[] = { /* PC Code Page 869 to ELOT 927 */
  2315. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2316. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2317. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2318. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2319. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2320. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2321. 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2322. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127,
  2323. UNK, UNK, UNK, UNK, UNK, UNK, 97, UNK, 46, UNK, 124, 39, 39, 101, 45, 103,
  2324. 105, 105, 111, UNK, UNK, 116, 116, UNK, 120, 50, 51, 97, UNK, 101, 103, 105,
  2325. 105, 105, 111, 116, 97, 98, 99, 100, 101, 102, 103, UNK, 104, 105, 34, 34,
  2326. UNK, UNK, UNK, UNK, UNK, 106, 107, 108, 109, UNK, UNK, UNK, UNK, 110, 111, UNK,
  2327. UNK, UNK, UNK, UNK, UNK, UNK, 112, 113, UNK, UNK, UNK, UNK, UNK, UNK, UNK, 114,
  2328. 115, 116, 117, 118, 119, 120, 97, 98, 99, UNK, UNK, UNK, UNK, 100, 101, UNK,
  2329. 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115, 39,
  2330. 45, UNK, 116, 117, 118, UNK, 119, UNK, UNK, UNK, 120, 116, 116, 120, UNK, 32
  2331. };
  2332. /*
  2333. 7-bit table providing readable translation from ELOT 927 to ISO Latin/Greek.
  2334. */
  2335. CONST CHAR
  2336. yeglg[] = {
  2337. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2338. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2339. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2340. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2341. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2342. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2343. 96, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  2344. 208, 209, 211, 212, 213, 214, 215, 216, 217, 32, 32, 123, 124, 125, 126, 127
  2345. };
  2346. /*
  2347. 8-bit table providing readable translation from ISO Latin/Greek to ELOT 927.
  2348. */
  2349. CONST CHAR
  2350. ylgeg[] = { /* Latin/Greek to ELOT 927 */
  2351. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2352. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  2353. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  2354. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  2355. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2356. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  2357. 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  2358. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127,
  2359. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2360. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  2361. 32, 39, 39, UNK, UNK, UNK, 124, UNK, 34, UNK, UNK, 34, UNK, 45, UNK, 45,
  2362. UNK, UNK, 50, 51, 39, UNK, 97, 46, 101, 103, 105, 34, 111, UNK, 116, 120,
  2363. UNK, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2364. 112, 113, UNK, 114, 115, 116, 117, 118, 119, 120, 105, 116, 97, 101, 103, 105,
  2365. 116, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  2366. 112, 113, 114, 114, 115, 116, 117, 118, 119, 120, 105, 116, 111, 116, 120, UNK
  2367. };
  2368. #endif /* GREEK */
  2369. /* Translation functions ... */
  2370. CHAR /* The identity function... */
  2371. #ifdef CK_ANSIC
  2372. ident(CHAR c) /* (no longer used) */
  2373. #else
  2374. ident(c) CHAR c;
  2375. #endif /* CK_ANSIC */
  2376. { /* ident */
  2377. return(c); /* Instead, enter NULL in the */
  2378. } /* table of functions to avoid */
  2379. /* needless function calls. */
  2380. CHAR
  2381. #ifdef CK_ANSIC
  2382. xleft128(CHAR c)
  2383. #else
  2384. xleft128(c) CHAR c;
  2385. #endif /* CK_ANSIC */
  2386. { /* xleft128 */
  2387. return((c < 128) ? c : '?');
  2388. }
  2389. CHAR
  2390. #ifdef CK_ANSIC
  2391. xleft160(CHAR c)
  2392. #else
  2393. xleft160(c) CHAR c;
  2394. #endif /* CK_ANSIC */
  2395. { /* xleft160 */
  2396. return((c < 160) ? c : '?');
  2397. }
  2398. CHAR
  2399. #ifdef CK_ANSIC
  2400. xl1as(CHAR c)
  2401. #else
  2402. xl1as(c) CHAR c;
  2403. #endif /* CK_ANSIC */
  2404. { /* xl1as */ /* Latin-1 to US ASCII... */
  2405. switch(langs[language].id) {
  2406. case L_DUTCH:
  2407. if (c == 255) { /* Dutch umlaut-y */
  2408. zmstuff('j'); /* becomes ij */
  2409. return('i');
  2410. } else return(yl1as[c]); /* all others by the book */
  2411. case L_GERMAN:
  2412. switch (c) { /* German, special rules. */
  2413. case 196: /* umlaut-A -> Ae */
  2414. zmstuff('e');
  2415. return('A');
  2416. case 214: /* umlaut-O -> Oe */
  2417. zmstuff('e');
  2418. return('O');
  2419. case 220: /* umlaut-U -> Ue */
  2420. zmstuff('e');
  2421. return('U');
  2422. case 228: /* umlaut-a -> ae */
  2423. zmstuff('e');
  2424. return('a');
  2425. case 246: /* umlaut-o -> oe */
  2426. zmstuff('e');
  2427. return('o');
  2428. case 252: /* umlaut-u -> ue */
  2429. zmstuff('e');
  2430. return('u');
  2431. case 223: /* ess-zet -> ss */
  2432. zmstuff('s');
  2433. return('s');
  2434. default: return(yl1as[c]); /* all others by the book */
  2435. }
  2436. case L_DANISH:
  2437. case L_FINNISH:
  2438. case L_NORWEGIAN:
  2439. case L_SWEDISH:
  2440. switch (c) { /* Scandanavian languages. */
  2441. case 196: /* umlaut-A -> Ae */
  2442. case 198: /* AE ligature also -> Ae */
  2443. zmstuff('e');
  2444. return('A');
  2445. case 214: /* umlaut-O -> Oe */
  2446. case 216: /* O-slash -> Oe */
  2447. zmstuff('e');
  2448. return('O');
  2449. case 220: /* umlaut-U -> Ue */
  2450. /* return('Y'); replaced by "Ue" by popular demand. */
  2451. /* Y for Umlaut-U is only used in German names. */
  2452. zmstuff('e');
  2453. return('U');
  2454. case 228: /* umlaut-a -> ae */
  2455. case 230: /* ditto for ae ligature */
  2456. zmstuff('e');
  2457. return('a');
  2458. case 246: /* umlaut-o -> oe */
  2459. case 248: /* o-slash -> oe */
  2460. zmstuff('e');
  2461. return('o');
  2462. case 252: /* umlaut-u -> ue */
  2463. /* return('y'); replaced by "ue" by popular demand. */
  2464. zmstuff('e');
  2465. return('u');
  2466. case 197: /* A-ring -> Aa */
  2467. zmstuff('a');
  2468. return('A');
  2469. case 229: /* a-ring -> aa */
  2470. zmstuff('a');
  2471. return('a');
  2472. default: return(yl1as[c]); /* All others by the book */
  2473. }
  2474. case L_ICELANDIC: /* Icelandic. */
  2475. switch (c) {
  2476. case 198: /* uppercase AE -> AE */
  2477. zmstuff('e');
  2478. return('A');
  2479. case 208: /* uppercase Eth -> D */
  2480. return('D');
  2481. case 214: /* uppercase O-diaeresis -> Oe */
  2482. zmstuff('e');
  2483. return('O');
  2484. case 222: /* uppercase Thorn -> Th */
  2485. zmstuff('h');
  2486. return('T');
  2487. case 230: /* lowercase ae -> ae */
  2488. zmstuff('e');
  2489. return('a');
  2490. case 240: /* lowercase Eth -> d */
  2491. return('d');
  2492. case 246: /* lowercase O-diaeresis -> oe */
  2493. zmstuff('e');
  2494. return('o');
  2495. case 254: /* lowercase Thorn -> th */
  2496. zmstuff('h');
  2497. return('t');
  2498. default: return(yl1as[c]); /* All others by the book */
  2499. }
  2500. default:
  2501. return(yl1as[c]); /* None of the above, by the table. */
  2502. }
  2503. }
  2504. CHAR /* CP1252 to ASCII */
  2505. #ifdef CK_ANSIC
  2506. xw1as(CHAR c)
  2507. #else
  2508. xw1as(c) CHAR c;
  2509. #endif /* CK_ANSIC */
  2510. { /* xw1as */
  2511. switch(c) { /* Microsoft name... */
  2512. case 0x80: return('?'); /* Euro Sign */
  2513. case 0x82: return('\047'); /* Single Low-9 Quotation Mark */
  2514. case 0x83: return('f'); /* Latin Small Letter f with Hook */
  2515. case 0x84: return('"'); /* Double low-9 Quotation Mark */
  2516. case 0x85: return('-'); /* Horizontal Ellipsis */
  2517. case 0x86: return('+'); /* Dagger */
  2518. case 0x87: return('+'); /* Double Dagger */
  2519. case 0x88: return('^'); /* Modifier Letter Circumflex Accent */
  2520. case 0x89: return('?'); /* Per Mille Sign */
  2521. case 0x8A: return('S'); /* Latin Capital Letter S with Caron */
  2522. case 0x8B: return('<'); /* Single Left Angle Quotation Mark */
  2523. case 0x8C: return('O'); /* Latin Capital Ligature OE */
  2524. case 0x8E: return('Z'); /* Latin Capital Letter Z with Caron */
  2525. case 0x91: return('\047'); /* Left Single Quotation Mark */
  2526. case 0x92: return('\047'); /* Right Single Quotation Mark */
  2527. case 0x93: return('"'); /* Left Double Quotation Mark */
  2528. case 0x94: return('"'); /* Right Double Quotation Mark */
  2529. case 0x95: return('.'); /* Bullet */
  2530. case 0x96: return('-'); /* En Dash */
  2531. case 0x97: return('-'); /* Em Dash */
  2532. case 0x98: return('~'); /* Small Tilde */
  2533. case 0x99: return('T'); /* Trade Mark Sign */
  2534. case 0x9A: return('s'); /* Latin Small Letter s with Caron */
  2535. case 0x9B: return('>'); /* Single Right Angle Quotation Mark */
  2536. case 0x9C: return('o'); /* Latin Small Ligature OE */
  2537. case 0x9E: return('z'); /* Latin Small Letter z with Caron */
  2538. case 0x9F: return('Y'); /* Latin Capital Letter Y Diaeresis */
  2539. default:
  2540. if (c > 0x80 && c < 0xa0)
  2541. return('?');
  2542. else
  2543. return(yl1as[c]);
  2544. }
  2545. }
  2546. CHAR /* CP1252 to Latin-1 */
  2547. #ifdef CK_ANSIC
  2548. xw1l1(CHAR c)
  2549. #else
  2550. xw1l1(c) CHAR c;
  2551. #endif /* CK_ANSIC */
  2552. { /* xw1l1 */
  2553. if (c == 0x95) return(0xb7); /* Middle dot */
  2554. return((c < 160) ? xw1as(c) : c);
  2555. }
  2556. CHAR /* Latin-1 to German */
  2557. #ifdef CK_ANSIC
  2558. xl1ge(CHAR c)
  2559. #else
  2560. xl1ge(c) CHAR c;
  2561. #endif /* CK_ANSIC */
  2562. { /* xl1ge */
  2563. return(yl1ge[c]);
  2564. }
  2565. CHAR /* German to Latin-1 */
  2566. #ifdef CK_ANSIC
  2567. xgel1(CHAR c)
  2568. #else
  2569. xgel1(c) CHAR c;
  2570. #endif /* CK_ANSIC */
  2571. { /* xgel1 */
  2572. if (c & 0x80)
  2573. return(UNK);
  2574. return(ygel1[c]);
  2575. }
  2576. CHAR
  2577. #ifdef CK_ANSIC
  2578. xgeas(CHAR c)
  2579. #else
  2580. xgeas(c) CHAR c;
  2581. #endif /* CK_ANSIC */
  2582. { /* xgeas */ /* German ISO 646 to ASCII */
  2583. if (c & 0x80)
  2584. return(UNK);
  2585. switch (c) {
  2586. case 91: /* umlaut-A -> Ae */
  2587. zmstuff('e');
  2588. return('A');
  2589. case 92: /* umlaut-O -> Oe */
  2590. zmstuff('e');
  2591. return('O');
  2592. case 93: /* umlaut-U -> Ue */
  2593. zmstuff('e');
  2594. return('U');
  2595. case 123: /* umlaut-a -> ae */
  2596. zmstuff('e');
  2597. return('a');
  2598. case 124: /* umlaut-o -> oe */
  2599. zmstuff('e');
  2600. return('o');
  2601. case 125: /* umlaut-u -> ue */
  2602. zmstuff('e');
  2603. return('u');
  2604. case 126: /* ess-zet -> ss */
  2605. zmstuff('s');
  2606. return('s');
  2607. default: return(c); /* all others stay the same */
  2608. }
  2609. }
  2610. CHAR
  2611. #ifdef CK_ANSIC
  2612. xl1w1(CHAR c)
  2613. #else
  2614. xl1w1(c) CHAR c;
  2615. #endif /* CK_ANSIC */
  2616. { /* xl1w1 */ /* Latin-1 to CP1252 (Windows L1) */
  2617. if (c > 127 && c < 160)
  2618. return(UNK);
  2619. else
  2620. return(c);
  2621. }
  2622. CHAR
  2623. #ifdef CK_ANSIC
  2624. xduas(CHAR c)
  2625. #else
  2626. xduas(c) CHAR c;
  2627. #endif /* CK_ANSIC */
  2628. { /* xduas */ /* Dutch ISO 646 to US ASCII */
  2629. if (c & 0x80)
  2630. return(UNK);
  2631. switch (c) {
  2632. case 64: return(UNK); /* 3/4 */
  2633. case 91: /* y-diaeresis */
  2634. zmstuff('j');
  2635. return('i');
  2636. case 92: return(UNK); /* 1/2 */
  2637. case 93: return(124); /* vertical bar */
  2638. case 123: return(34); /* diaeresis */
  2639. case 124: return(UNK); /* Florin */
  2640. case 125: return(UNK); /* 1/4 */
  2641. case 126: return(39); /* Apostrophe */
  2642. default: return(c);
  2643. }
  2644. }
  2645. CHAR
  2646. #ifdef CK_ANSIC
  2647. xfias(CHAR c)
  2648. #else
  2649. xfias(c) CHAR c;
  2650. #endif /* CK_ANSIC */
  2651. { /* xfias */ /* Finnish ISO 646 to US ASCII */
  2652. if (c & 0x80)
  2653. return(UNK);
  2654. switch (c) {
  2655. case 91: /* A-diaeresis */
  2656. zmstuff('e');
  2657. return('A');
  2658. case 92: /* O-diaeresis */
  2659. zmstuff('e');
  2660. return('O');
  2661. case 93: /* A-ring */
  2662. zmstuff('a');
  2663. return('A');
  2664. case 94: /* U-diaeresis */
  2665. /* return('Y'); */
  2666. zmstuff('e');
  2667. return('U');
  2668. case 96: /* e-acute */
  2669. return('e');
  2670. case 123: /* a-diaeresis */
  2671. zmstuff('e');
  2672. return('a');
  2673. case 124: /* o-diaeresis */
  2674. zmstuff('e');
  2675. return('o');
  2676. case 125: /* a-ring */
  2677. zmstuff('a');
  2678. return('a');
  2679. case 126: /* u-diaeresis */
  2680. /* return('y'); */
  2681. zmstuff('e');
  2682. return('U');
  2683. default:
  2684. return(c);
  2685. }
  2686. }
  2687. CHAR
  2688. #ifdef CK_ANSIC
  2689. xfras(CHAR c)
  2690. #else
  2691. xfras(c) CHAR c;
  2692. #endif /* CK_ANSIC */
  2693. { /* xfras */ /* French ISO 646 to US ASCII */
  2694. if (c & 0x80)
  2695. return(UNK);
  2696. switch (c) {
  2697. case 64: return(97); /* a grave */
  2698. case 91: return(UNK); /* degree sign */
  2699. case 92: return(99); /* c cedilla */
  2700. case 93: return(UNK); /* paragraph sign */
  2701. case 123: return(101); /* e acute */
  2702. case 124: return(117); /* u grave */
  2703. case 125: return(101); /* e grave */
  2704. case 126: return(34); /* diaeresis */
  2705. default: return(c);
  2706. }
  2707. }
  2708. CHAR
  2709. #ifdef CK_ANSIC
  2710. xfcas(CHAR c)
  2711. #else
  2712. xfcas(c) CHAR c;
  2713. #endif /* CK_ANSIC */
  2714. { /* xfcas */ /* French Canadian ISO 646 to ASCII */
  2715. if (c & 0x80)
  2716. return(UNK);
  2717. switch (c) {
  2718. case 64: return('a'); /* a grave */
  2719. case 91: return('a'); /* a circumflex */
  2720. case 92: return('c'); /* c cedilla */
  2721. case 93: return('e'); /* e circumflex */
  2722. case 94: return('i'); /* i circumflex */
  2723. case 96: return('o'); /* o circumflex */
  2724. case 123: return('e'); /* e acute */
  2725. case 124: return('u'); /* u grave */
  2726. case 125: return('e'); /* e grave */
  2727. case 126: return('u'); /* u circumflex */
  2728. default: return(c);
  2729. }
  2730. }
  2731. CHAR
  2732. #ifdef CK_ANSIC
  2733. xitas(CHAR c)
  2734. #else
  2735. xitas(c) CHAR c;
  2736. #endif /* CK_ANSIC */
  2737. { /* xitas */ /* Italian ISO 646 to ASCII */
  2738. if (c & 0x80)
  2739. return(UNK);
  2740. switch (c) {
  2741. case 91: return(UNK); /* degree */
  2742. case 92: return('c'); /* c cedilla */
  2743. case 93: return('e'); /* e acute */
  2744. case 96: return('u'); /* u grave */
  2745. case 123: return('a'); /* a grave */
  2746. case 124: return('o'); /* o grave */
  2747. case 125: return('e'); /* e grave */
  2748. case 126: return('i'); /* i grave */
  2749. default: return(c);
  2750. }
  2751. }
  2752. CHAR
  2753. #ifdef CK_ANSIC
  2754. xneas(CHAR c)
  2755. #else
  2756. xneas(c) CHAR c;
  2757. #endif /* CK_ANSIC */
  2758. { /* xneas */ /* NeXT to ASCII */
  2759. if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2760. if (c == 234) { /* handle OE digraph. */
  2761. zmstuff('E');
  2762. return('O');
  2763. } else if (c == 250) { /* Also lowercase oe. */
  2764. zmstuff('e');
  2765. return('o');
  2766. }
  2767. }
  2768. c = xnel1(c); /* Convert to Latin-1 */
  2769. return(yl1as[c]); /* Convert Latin-1 to ASCII */
  2770. }
  2771. CHAR
  2772. #ifdef CK_ANSIC
  2773. xnoas(CHAR c)
  2774. #else
  2775. xnoas(c) CHAR c;
  2776. #endif /* CK_ANSIC */
  2777. { /* xnoas */ /* Norge/Danish ISO 646 to ASCII */
  2778. if (c & 0x80)
  2779. return(UNK);
  2780. switch (c) {
  2781. case 91:
  2782. zmstuff('E'); /* AE digraph */
  2783. return('A');
  2784. case 92: return('O'); /* O slash */
  2785. case 93: /* A ring */
  2786. zmstuff('a');
  2787. return('A');
  2788. case 123: /* ae digraph */
  2789. zmstuff('e');
  2790. return('a');
  2791. case 124: return('o'); /* o slash */
  2792. case 125: /* a ring */
  2793. zmstuff('a');
  2794. return('a');
  2795. default: return(c);
  2796. }
  2797. }
  2798. CHAR
  2799. #ifdef CK_ANSIC
  2800. xpoas(CHAR c)
  2801. #else
  2802. xpoas(c) CHAR c;
  2803. #endif /* CK_ANSIC */
  2804. { /* xpoas */ /* Portuguese ISO 646 to ASCII */
  2805. if (c & 0x80)
  2806. return(UNK);
  2807. switch (c) {
  2808. case 91: return('A'); /* A tilde */
  2809. case 92: return('C'); /* C cedilla */
  2810. case 93: return('O'); /* O tilde */
  2811. case 123: return('a'); /* a tilde */
  2812. case 124: return('c'); /* c cedilla */
  2813. case 125: return('o'); /* o tilde */
  2814. default: return(c);
  2815. }
  2816. }
  2817. CHAR
  2818. #ifdef CK_ANSIC
  2819. xspas(CHAR c)
  2820. #else
  2821. xspas(c) CHAR c;
  2822. #endif /* CK_ANSIC */
  2823. { /* xspas */ /* Spanish ISO 646 to ASCII */
  2824. if (c & 0x80)
  2825. return(UNK);
  2826. switch (c) {
  2827. case 91: return(33); /* Inverted exclamation */
  2828. case 92: return('N'); /* N tilde */
  2829. case 93: return(63); /* Inverted question mark */
  2830. case 123: return(UNK); /* degree */
  2831. case 124: return('n'); /* n tilde */
  2832. case 125: return('c'); /* c cedilla */
  2833. default: return(c);
  2834. }
  2835. }
  2836. CHAR
  2837. #ifdef CK_ANSIC
  2838. xswas(CHAR c)
  2839. #else
  2840. xswas(c) CHAR c;
  2841. #endif /* CK_ANSIC */
  2842. { /* xswas */ /* Swedish ISO 646 to ASCII */
  2843. if (c & 0x80)
  2844. return(UNK);
  2845. switch (c) {
  2846. case 64: return('E'); /* E acute */
  2847. case 91: /* A diaeresis */
  2848. zmstuff('e');
  2849. return('A');
  2850. case 92: /* O diaeresis */
  2851. zmstuff('e');
  2852. return('O');
  2853. case 93: /* A ring */
  2854. zmstuff('a');
  2855. return('A');
  2856. case 94: /* U diaeresis */
  2857. /* return('Y'); */
  2858. zmstuff('e');
  2859. return('U');
  2860. case 96: return('e'); /* e acute */
  2861. case 123: /* a diaeresis */
  2862. zmstuff('e');
  2863. return('a');
  2864. case 124: /* o diaeresis */
  2865. zmstuff('e');
  2866. return('o');
  2867. case 125: /* a ring */
  2868. zmstuff('a');
  2869. return('a');
  2870. case 126: /* u diaeresis */
  2871. /* return('y'); */
  2872. zmstuff('e');
  2873. return('u');
  2874. default: return(c);
  2875. }
  2876. }
  2877. CHAR
  2878. #ifdef CK_ANSIC
  2879. xchas(CHAR c)
  2880. #else
  2881. xchas(c) CHAR c;
  2882. #endif /* CK_ANSIC */
  2883. { /* xchas */ /* Swiss ISO 646 to ASCII */
  2884. if (c & 0x80)
  2885. return(UNK);
  2886. switch (c) {
  2887. case 35: return('u'); /* u grave */
  2888. case 64: return('a'); /* a grave */
  2889. case 91: return('e'); /* e acute */
  2890. case 92: return('c'); /* c cedilla */
  2891. case 93: return('e'); /* e circumflex */
  2892. case 94: return('i'); /* i circumflex */
  2893. case 95: return('e'); /* e grave */
  2894. case 96: return('o'); /* o circumflex */
  2895. case 123: /* a diaeresis */
  2896. zmstuff('e');
  2897. return('a');
  2898. case 124: /* o diaeresis */
  2899. zmstuff('e');
  2900. return('o');
  2901. case 125: /* u diaeresis */
  2902. zmstuff('e');
  2903. return('u');
  2904. case 126: return('u'); /* u circumflex */
  2905. default: return(c);
  2906. }
  2907. }
  2908. CHAR
  2909. #ifdef CK_ANSIC
  2910. xhuas(CHAR c)
  2911. #else
  2912. xhuas(c) CHAR c;
  2913. #endif /* CK_ANSIC */
  2914. { /* xhuas */ /* Hungarian ISO 646 to ASCII */
  2915. if (c & 0x80)
  2916. return(UNK);
  2917. switch (c) {
  2918. case 64: return('A'); /* A acute */
  2919. case 91: return('E'); /* E acute */
  2920. case 92: return('O'); /* O diaeresis */
  2921. case 93: return('U'); /* U diaeresis */
  2922. case 96: return('a'); /* a acute */
  2923. case 123: return('e'); /* e acute */
  2924. case 124: return('o'); /* o acute */
  2925. case 125: return('u'); /* u acute */
  2926. case 126: return(34); /* double acute accent */
  2927. default: return(c);
  2928. }
  2929. }
  2930. CHAR
  2931. #ifdef CK_ANSIC
  2932. xdmas(CHAR c)
  2933. #else
  2934. xdmas(c) CHAR c;
  2935. #endif /* CK_ANSIC */
  2936. { /* xdmas */ /* DEC MCS to ASCII */
  2937. if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2938. if (c == 215) { /* handle OE digraph. */
  2939. zmstuff('E');
  2940. return('O');
  2941. } else if (c == 247) { /* Also lowercase oe. */
  2942. zmstuff('e');
  2943. return('o');
  2944. }
  2945. }
  2946. return(yl1as[c]); /* Otherwise treat like Latin-1 */
  2947. }
  2948. CHAR
  2949. #ifdef CK_ANSIC
  2950. xdgas(CHAR c)
  2951. #else
  2952. xdgas(c) CHAR c;
  2953. #endif /* CK_ANSIC */
  2954. { /* xdgas */ /* Data General to ASCII */
  2955. switch(c) {
  2956. case 180: return('f'); /* Florin */
  2957. case 183: return('<'); /* Less-equal */
  2958. case 184: return('>'); /* Greater-equal */
  2959. case 186: return(96); /* Grave accent */
  2960. case 191: return('^'); /* Uparrow */
  2961. case 215:
  2962. if (langs[language].id == L_FRENCH) { /* OE digraph */
  2963. zmstuff('E');
  2964. return('O');
  2965. } else return('O');
  2966. case 247:
  2967. if (langs[language].id == L_FRENCH) { /* oe digraph */
  2968. zmstuff('e');
  2969. return('o');
  2970. } else return('o');
  2971. case 175: case 179: case 220: case 222:
  2972. case 223: case 254: case 255:
  2973. return(UNK);
  2974. default: /* The rest, convert to Latin-1 */
  2975. return(yl1as[ydgl1[c]]); /* and from there to ASCII */
  2976. }
  2977. }
  2978. CHAR
  2979. #ifdef CK_ANSIC
  2980. xr8as(CHAR c)
  2981. #else
  2982. xr8as(c) CHAR c;
  2983. #endif /* CK_ANSIC */
  2984. { /* xr8as */ /* Hewlett Packard Roman8 to ASCII */
  2985. switch(c) {
  2986. case 175: return('L'); /* Lira */
  2987. case 190: return('f'); /* Florin */
  2988. case 235: return('S'); /* S caron */
  2989. case 236: return('s'); /* s caron */
  2990. case 246: return('-'); /* Horizontal bar */
  2991. case 252: return('*'); /* Solid box */
  2992. default: /* The rest, convert to Latin-1 */
  2993. return(yl1as[yr8l1[c]]); /* and from there to ASCII */
  2994. }
  2995. }
  2996. CHAR
  2997. #ifdef CK_ANSIC
  2998. xukl1(CHAR c)
  2999. #else
  3000. xukl1(c) CHAR c;
  3001. #endif /* CK_ANSIC */
  3002. { /* xukl1 */ /* UK ASCII to Latin-1 */
  3003. if (c & 0x80)
  3004. return(UNK);
  3005. if (c == 35)
  3006. return(163);
  3007. else return(c);
  3008. }
  3009. CHAR
  3010. #ifdef CK_ANSIC
  3011. xl1uk(CHAR c)
  3012. #else
  3013. xl1uk(c) CHAR c;
  3014. #endif /* CK_ANSIC */
  3015. { /* xl1uk */ /* Latin-1 to UK ASCII */
  3016. if (c == 163)
  3017. return(35);
  3018. else return(yl1as[c]);
  3019. }
  3020. CHAR /* Latin-1 to French ISO 646 */
  3021. #ifdef CK_ANSIC
  3022. xl1fr(CHAR c)
  3023. #else
  3024. xl1fr(c) CHAR c;
  3025. #endif /* CK_ANSIC */
  3026. { /* xl1fr */
  3027. return(yl1fr[c]);
  3028. }
  3029. CHAR /* French ISO 646 to Latin-1 */
  3030. #ifdef CK_ANSIC
  3031. xfrl1(CHAR c)
  3032. #else
  3033. xfrl1(c) CHAR c;
  3034. #endif /* CK_ANSIC */
  3035. { /* xfrl1 */
  3036. if (c & 0x80)
  3037. return(UNK);
  3038. return(yfrl1[c]);
  3039. }
  3040. CHAR /* Latin-1 to Dutch ASCII */
  3041. #ifdef CK_ANSIC
  3042. xl1du(CHAR c)
  3043. #else
  3044. xl1du(c) CHAR c;
  3045. #endif /* CK_ANSIC */
  3046. { /* xl1du */
  3047. return(yl1du[c]);
  3048. }
  3049. CHAR
  3050. #ifdef CK_ANSIC
  3051. xdul1(CHAR c)
  3052. #else
  3053. xdul1(c) CHAR c;
  3054. #endif /* CK_ANSIC */
  3055. { /* xdul1 */ /* Dutch ISO 646 to Latin-1 */
  3056. if (c & 0x80)
  3057. return(UNK);
  3058. return(ydul1[c]);
  3059. }
  3060. CHAR
  3061. #ifdef CK_ANSIC
  3062. xfil1(CHAR c)
  3063. #else
  3064. xfil1(c) CHAR c;
  3065. #endif /* CK_ANSIC */
  3066. { /* xfil1 */ /* Finnish ISO 646 to Latin-1 */
  3067. if (c & 0x80)
  3068. return(UNK);
  3069. return(yfil1[c]);
  3070. }
  3071. CHAR
  3072. #ifdef CK_ANSIC
  3073. xl1fi(CHAR c)
  3074. #else
  3075. xl1fi(c) CHAR c;
  3076. #endif /* CK_ANSIC */
  3077. { /* xl1fi */ /* Latin-1 to Finnish ISO 646 */
  3078. return(yl1fi[c]);
  3079. }
  3080. CHAR
  3081. #ifdef CK_ANSIC
  3082. xfcl1(CHAR c)
  3083. #else
  3084. xfcl1(c) CHAR c;
  3085. #endif /* CK_ANSIC */
  3086. { /* xfcl1 */ /* French Canadian ISO646 to Latin-1 */
  3087. if (c & 0x80)
  3088. return(UNK);
  3089. return(yfcl1[c]);
  3090. }
  3091. CHAR
  3092. #ifdef CK_ANSIC
  3093. xl1fc(CHAR c)
  3094. #else
  3095. xl1fc(c) CHAR c;
  3096. #endif /* CK_ANSIC */
  3097. { /* xl1fc */ /* Latin-1 to French Canadian ISO646 */
  3098. return(yl1fc[c]);
  3099. }
  3100. CHAR
  3101. #ifdef CK_ANSIC
  3102. xitl1(CHAR c)
  3103. #else
  3104. xitl1(c) CHAR c;
  3105. #endif /* CK_ANSIC */
  3106. { /* xitl1 */ /* Italian ISO 646 to Latin-1 */
  3107. if (c & 0x80)
  3108. return(UNK);
  3109. return(yitl1[c]);
  3110. }
  3111. CHAR
  3112. #ifdef CK_ANSIC
  3113. xl1it(CHAR c)
  3114. #else
  3115. xl1it(c) CHAR c;
  3116. #endif /* CK_ANSIC */
  3117. { /* xl1it */ /* Latin-1 to Italian ISO 646 */
  3118. return(yl1it[c]);
  3119. }
  3120. CHAR
  3121. #ifdef CK_ANSIC
  3122. xnel1(CHAR c)
  3123. #else
  3124. xnel1(c) CHAR c;
  3125. #endif /* CK_ANSIC */
  3126. { /* xnel1 */ /* NeXT to Latin-1 */
  3127. if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  3128. if (c == 234) { /* handle OE digraph. */
  3129. zmstuff('E');
  3130. return('O');
  3131. } else if (c == 250) { /* Also lowercase oe. */
  3132. zmstuff('e');
  3133. return('o');
  3134. }
  3135. }
  3136. return(ynel1[c]);
  3137. }
  3138. CHAR
  3139. #ifdef CK_ANSIC
  3140. xnel9(CHAR c)
  3141. #else
  3142. xnel9(c) CHAR c;
  3143. #endif /* CK_ANSIC */
  3144. { /* xnel9 */ /* NeXT to Latin-9 */
  3145. switch (c) {
  3146. case 234: return(188); /* OE */
  3147. case 250: return(189); /* oe */
  3148. case 188: return(234); /* keep it invertible... */
  3149. case 189: return(250); /* oe */
  3150. default:
  3151. return(ynel1[c]);
  3152. }
  3153. }
  3154. CHAR
  3155. #ifdef CK_ANSIC
  3156. xl1ne(CHAR c)
  3157. #else
  3158. xl1ne(c) CHAR c;
  3159. #endif /* CK_ANSIC */
  3160. { /* xl1ne */ /* Latin-1 to NeXT */
  3161. return(yl1ne[c]);
  3162. }
  3163. CHAR
  3164. #ifdef CK_ANSIC
  3165. xl9ne(CHAR c)
  3166. #else
  3167. xl9ne(c) CHAR c;
  3168. #endif /* CK_ANSIC */
  3169. { /* xl9ne */ /* Latin-9 to NeXT */
  3170. switch (c) {
  3171. case 188: return(234); /* OE */
  3172. case 189: return(250); /* oe */
  3173. case 234: return(188); /* OE */
  3174. case 250: return(189); /* oe */
  3175. default:
  3176. return(yl1ne[c]);
  3177. }
  3178. }
  3179. CHAR
  3180. #ifdef CK_ANSIC
  3181. xnol1(CHAR c)
  3182. #else
  3183. xnol1(c) CHAR c;
  3184. #endif /* CK_ANSIC */
  3185. { /* xnol1 */ /* Norway/Denmark ISO 646 to Latin-1 */
  3186. if (c & 0x80)
  3187. return(UNK);
  3188. return(ynol1[c]);
  3189. }
  3190. CHAR
  3191. #ifdef CK_ANSIC
  3192. xl1no(CHAR c)
  3193. #else
  3194. xl1no(c) CHAR c;
  3195. #endif /* CK_ANSIC */
  3196. { /* xl1no */ /* Latin-1 to Norway/Denmark ISO 646 */
  3197. return(yl1no[c]);
  3198. }
  3199. CHAR
  3200. #ifdef CK_ANSIC
  3201. xpol1(CHAR c)
  3202. #else
  3203. xpol1(c) CHAR c;
  3204. #endif /* CK_ANSIC */
  3205. { /* xpol1 */ /* Portuguese ISO 646 to Latin-1 */
  3206. if (c & 0x80)
  3207. return(UNK);
  3208. return(ypol1[c]);
  3209. }
  3210. CHAR
  3211. #ifdef CK_ANSIC
  3212. xl1po(CHAR c)
  3213. #else
  3214. xl1po(c) CHAR c;
  3215. #endif /* CK_ANSIC */
  3216. { /* xl1po */ /* Latin-1 to Portuguese ISO 646 */
  3217. return(yl1po[c]);
  3218. }
  3219. CHAR
  3220. #ifdef CK_ANSIC
  3221. xspl1(CHAR c)
  3222. #else
  3223. xspl1(c) CHAR c;
  3224. #endif /* CK_ANSIC */
  3225. { /* xspl1 */ /* Spanish ISO 646 to Latin-1 */
  3226. if (c & 0x80)
  3227. return(UNK);
  3228. return(yspl1[c]);
  3229. }
  3230. CHAR
  3231. #ifdef CK_ANSIC
  3232. xl1sp(CHAR c)
  3233. #else
  3234. xl1sp(c) CHAR c;
  3235. #endif /* CK_ANSIC */
  3236. { /* xl1sp */ /* Latin-1 to Spanish ISO 646 */
  3237. return(yl1sp[c]);
  3238. }
  3239. CHAR
  3240. #ifdef CK_ANSIC
  3241. xswl1(CHAR c)
  3242. #else
  3243. xswl1(c) CHAR c;
  3244. #endif /* CK_ANSIC */
  3245. { /* xswl1 */ /* Swedish ISO 646 to Latin-1 */
  3246. if (c & 0x80)
  3247. return(UNK);
  3248. return(yswl1[c]);
  3249. }
  3250. CHAR
  3251. #ifdef CK_ANSIC
  3252. xl1sw(CHAR c)
  3253. #else
  3254. xl1sw(c) CHAR c;
  3255. #endif /* CK_ANSIC */
  3256. { /* xl1sw */ /* Latin-1 to Swedish ISO 646 */
  3257. return(yl1sw[c]);
  3258. }
  3259. CHAR
  3260. #ifdef CK_ANSIC
  3261. xchl1(CHAR c)
  3262. #else
  3263. xchl1(c) CHAR c;
  3264. #endif /* CK_ANSIC */
  3265. { /* xchl1 */ /* Swiss ISO 646 to Latin-1 */
  3266. if (c & 0x80)
  3267. return(UNK);
  3268. return(ychl1[c]);
  3269. }
  3270. CHAR
  3271. #ifdef CK_ANSIC
  3272. xl1ch(CHAR c)
  3273. #else
  3274. xl1ch(c) CHAR c;
  3275. #endif /* CK_ANSIC */
  3276. { /* xl1ch */ /* Latin-1 to Swiss ISO 646 */
  3277. return(yl1ch[c]);
  3278. }
  3279. CHAR
  3280. #ifdef CK_ANSIC
  3281. xhul1(CHAR c)
  3282. #else
  3283. xhul1(c) CHAR c;
  3284. #endif /* CK_ANSIC */
  3285. { /* xhul1 */ /* Hungarian ISO 646 to Latin-1 */
  3286. if (c & 0x80)
  3287. return(UNK);
  3288. return(yhul1[c]);
  3289. }
  3290. CHAR
  3291. #ifdef CK_ANSIC
  3292. xl1hu(CHAR c)
  3293. #else
  3294. xl1hu(c) CHAR c;
  3295. #endif /* CK_ANSIC */
  3296. { /* xl1hu */ /* Latin-1 to Hungarian ISO 646 */
  3297. return(yl1hu[c]);
  3298. }
  3299. CHAR
  3300. #ifdef CK_ANSIC
  3301. xl1dm(CHAR c)
  3302. #else
  3303. xl1dm(c) CHAR c;
  3304. #endif /* CK_ANSIC */
  3305. { /* xl1dm */ /* Latin-1 to DEC MCS */
  3306. return(yl1dm[c]);
  3307. }
  3308. CHAR
  3309. #ifdef CK_ANSIC
  3310. xl9dm(CHAR c)
  3311. #else
  3312. xl9dm(c) CHAR c;
  3313. #endif /* CK_ANSIC */
  3314. { /* xl9dm */ /* Latin-9 to DEC MCS */
  3315. switch (c) {
  3316. case 188: return(215);
  3317. case 189: return(247);
  3318. case 215: return(188);
  3319. case 247: return(189);
  3320. default:
  3321. return(yl1dm[c]);
  3322. }
  3323. }
  3324. CHAR
  3325. #ifdef CK_ANSIC
  3326. xl9w1(CHAR c)
  3327. #else
  3328. xl9w1(c) CHAR c;
  3329. #endif /* CK_ANSIC */
  3330. { /* xl9w1 */ /* Latin-9 to CP1252 */
  3331. if (c < 128)
  3332. return(c);
  3333. else if (c < 160)
  3334. return('?');
  3335. switch (c) {
  3336. case 0xa4: return(0x80); /* Euro */
  3337. case 0xa6: return(0x8a); /* S-caron */
  3338. case 0xa8: return(0x9a); /* s-caron */
  3339. case 0xb4: return(0x8e); /* Z-caron */
  3340. case 0xb8: return(0x9e); /* z-caron */
  3341. case 0xbc: return(0x8c); /* OE */
  3342. case 0xbd: return(0x9c); /* oe */
  3343. case 0xbe: return(0x9f); /* Y-diaeresis */
  3344. default:
  3345. return(c);
  3346. }
  3347. }
  3348. CHAR
  3349. #ifdef CK_ANSIC
  3350. xl1dg(CHAR c)
  3351. #else
  3352. xl1dg(c) CHAR c;
  3353. #endif /* CK_ANSIC */
  3354. { /* xl1dg */ /* Latin-1 to DG ICS */
  3355. return(yl1dg[c]);
  3356. }
  3357. CHAR
  3358. #ifdef CK_ANSIC
  3359. xdml1(CHAR c)
  3360. #else
  3361. xdml1(c) CHAR c;
  3362. #endif /* CK_ANSIC */
  3363. { /* xdml1 */ /* DEC MCS to Latin-1 */
  3364. if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  3365. if (c == 215) { /* handle OE digraph. */
  3366. zmstuff('E');
  3367. return('O');
  3368. } else if (c == 247) { /* Also lowercase oe. */
  3369. zmstuff('e');
  3370. return('o');
  3371. }
  3372. }
  3373. return(ydml1[c]);
  3374. }
  3375. CHAR
  3376. #ifdef CK_ANSIC
  3377. xdml9(CHAR c)
  3378. #else
  3379. xdml9(c) CHAR c;
  3380. #endif /* CK_ANSIC */
  3381. { /* xdml9 */ /* DEC MCS to Latin-9 */
  3382. switch (c) {
  3383. case 215: return(188); /* OE */
  3384. case 247: return(189); /* oe */
  3385. case 188: return(215); /* and swap the other two... */
  3386. case 189: return(247); /* (1/4 and 1/2) */
  3387. default: /* to keep it invertible */
  3388. return(ydml1[c]);
  3389. }
  3390. }
  3391. CHAR
  3392. #ifdef CK_ANSIC
  3393. xdgl1(CHAR c)
  3394. #else
  3395. xdgl1(c) CHAR c;
  3396. #endif /* CK_ANSIC */
  3397. { /* xdgl1 */ /* DG International CS to Latin-1 */
  3398. if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  3399. if (c == 215) { /* handle OE digraph. */
  3400. zmstuff('E');
  3401. return('O');
  3402. } else if (c == 247) { /* Also lowercase oe. */
  3403. zmstuff('e');
  3404. return('o');
  3405. }
  3406. }
  3407. return(ydgl1[c]);
  3408. }
  3409. CHAR
  3410. #ifdef CK_ANSIC
  3411. xr8l1(CHAR c)
  3412. #else
  3413. xr8l1(c) CHAR c;
  3414. #endif /* CK_ANSIC */
  3415. { /* xr8l1 */ /* Hewlett Packard Roman8 to Latin-1 */
  3416. return(yr8l1[c]);
  3417. }
  3418. CHAR
  3419. #ifdef CK_ANSIC
  3420. xl1r8(CHAR c)
  3421. #else
  3422. xl1r8(c) CHAR c;
  3423. #endif /* CK_ANSIC */
  3424. { /* xl1r8 */ /* Latin-1 to Hewlett Packard Roman8 */
  3425. return(yl1r8[c]);
  3426. }
  3427. /* Translation functions for receiving files and translating them into ASCII */
  3428. CHAR
  3429. #ifdef CK_ANSIC
  3430. zl1as(CHAR c)
  3431. #else
  3432. zl1as(c) CHAR c;
  3433. #endif /* CK_ANSIC */
  3434. { /* zl1as */
  3435. switch(langs[language].id) {
  3436. case L_DUTCH:
  3437. if (c == 255) { /* Dutch umlaut-y */
  3438. zdstuff('j'); /* becomes ij */
  3439. return('i');
  3440. } else return(yl1as[c]); /* all others by the book */
  3441. case L_GERMAN:
  3442. switch (c) { /* German, special rules. */
  3443. case 196: /* umlaut-A -> Ae */
  3444. zdstuff('e');
  3445. return('A');
  3446. case 214: /* umlaut-O -> Oe */
  3447. zdstuff('e');
  3448. return('O');
  3449. case 220: /* umlaut-U -> Ue */
  3450. zdstuff('e');
  3451. return('U');
  3452. case 228: /* umlaut-a -> ae */
  3453. zdstuff('e');
  3454. return('a');
  3455. case 246: /* umlaut-o -> oe */
  3456. zdstuff('e');
  3457. return('o');
  3458. case 252: /* umlaut-u -> ue */
  3459. zdstuff('e');
  3460. return('u');
  3461. case 223: /* ess-zet -> ss */
  3462. zdstuff('s');
  3463. return('s');
  3464. default: return(yl1as[c]); /* all others by the book */
  3465. }
  3466. case L_DANISH:
  3467. case L_FINNISH:
  3468. case L_NORWEGIAN:
  3469. case L_SWEDISH:
  3470. switch (c) { /* Scandanavian languages. */
  3471. case 196: /* umlaut-A -> Ae */
  3472. zdstuff('e');
  3473. return('A');
  3474. case 214: /* umlaut-O -> Oe */
  3475. case 216: /* O-slash -> Oe */
  3476. zdstuff('e');
  3477. return('O');
  3478. case 220: /* umlaut-U -> Y */
  3479. /* return('Y'); */
  3480. zdstuff('e');
  3481. return('U');
  3482. case 228: /* umlaut-a -> ae */
  3483. zdstuff('e');
  3484. return('a');
  3485. case 246: /* umlaut-o -> oe */
  3486. case 248: /* o-slash -> oe */
  3487. zdstuff('e');
  3488. return('o');
  3489. case 252: /* umlaut-u -> y */
  3490. /* return('y'); */
  3491. zdstuff('e');
  3492. return('u');
  3493. case 197: /* A-ring -> Aa */
  3494. zdstuff('a');
  3495. return('A');
  3496. case 229: /* a-ring -> aa */
  3497. zdstuff('a');
  3498. return('a');
  3499. default: return(yl1as[c]); /* All others by the book */
  3500. }
  3501. default:
  3502. return(yl1as[c]); /* No language, go by the table. */
  3503. }
  3504. }
  3505. CHAR /* IBM CP437 to Latin-1 */
  3506. #ifdef CK_ANSIC
  3507. x43l1(CHAR c)
  3508. #else
  3509. x43l1(c) CHAR c;
  3510. #endif /* CK_ANSIC */
  3511. { /* x43l1 */
  3512. return(y43l1[c]);
  3513. }
  3514. CHAR /* IBM CP850 to Latin-1 */
  3515. #ifdef CK_ANSIC
  3516. x85l1(CHAR c)
  3517. #else
  3518. x85l1(c) CHAR c;
  3519. #endif /* CK_ANSIC */
  3520. { /* x85l1 */
  3521. return(y85l1[c]);
  3522. }
  3523. CHAR /* Latin-1 to IBM CP437 */
  3524. #ifdef CK_ANSIC
  3525. xl143(CHAR c)
  3526. #else
  3527. xl143(c) CHAR c;
  3528. #endif /* CK_ANSIC */
  3529. { /* xl143 */
  3530. return(yl143[c]);
  3531. }
  3532. CHAR /* Latin-1 to CP850 */
  3533. #ifdef CK_ANSIC
  3534. xl185(CHAR c)
  3535. #else
  3536. xl185(c) CHAR c;
  3537. #endif /* CK_ANSIC */
  3538. { /* xl185 */
  3539. return(yl185[c]);
  3540. }
  3541. CHAR
  3542. #ifdef CK_ANSIC
  3543. x43as(CHAR c)
  3544. #else
  3545. x43as(c) CHAR c;
  3546. #endif /* CK_ANSIC */
  3547. { /* x43as */ /* CP437 to ASCII */
  3548. c = y43l1[c]; /* Translate to Latin-1 */
  3549. return(xl143(c)); /* and from Latin-1 to ASCII. */
  3550. }
  3551. CHAR
  3552. #ifdef CK_ANSIC
  3553. x85as(CHAR c)
  3554. #else
  3555. x85as(c) CHAR c;
  3556. #endif /* CK_ANSIC */
  3557. { /* x85as */ /* CP850 to ASCII */
  3558. c = y85l1[c]; /* Translate to Latin-1 */
  3559. return(xl1as(c)); /* and from Latin-1 to ASCII. */
  3560. }
  3561. CHAR /* Macintosh Latin to Latin-1 */
  3562. #ifdef CK_ANSIC
  3563. xaql1(CHAR c)
  3564. #else
  3565. xaql1(c) CHAR c;
  3566. #endif /* CK_ANSIC */
  3567. { /* xaql1 */
  3568. if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  3569. if (c == 206) { /* handle OE digraph. */
  3570. zmstuff('E');
  3571. return('O');
  3572. } else if (c == 207) { /* Also lowercase oe. */
  3573. zmstuff('e');
  3574. return('o');
  3575. }
  3576. }
  3577. return(yaql1[c]);
  3578. }
  3579. CHAR /* Macintosh Latin to ASCII */
  3580. #ifdef CK_ANSIC
  3581. xaqas(CHAR c)
  3582. #else
  3583. xaqas(c) CHAR c;
  3584. #endif /* CK_ANSIC */
  3585. { /* xaqas */
  3586. if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  3587. if (c == 206) { /* handle OE digraph. */
  3588. zmstuff('E');
  3589. return('O');
  3590. } else if (c == 207) { /* Also lowercase oe. */
  3591. zmstuff('e');
  3592. return('o');
  3593. }
  3594. }
  3595. c = yaql1[c]; /* Translate to Latin-1 */
  3596. return(xl1as(c)); /* then to ASCII. */
  3597. }
  3598. CHAR /* Latin-1 to Macintosh Latin */
  3599. #ifdef CK_ANSIC
  3600. xl1aq(CHAR c)
  3601. #else
  3602. xl1aq(c) CHAR c;
  3603. #endif /* CK_ANSIC */
  3604. { /* xl1aq */
  3605. return(yl1aq[c]);
  3606. }
  3607. #ifdef LATIN2
  3608. /* Translation functions for Latin Alphabet 2 */
  3609. CHAR /* Latin-2 to Latin-1 */
  3610. #ifdef CK_ANSIC
  3611. xl2l1(CHAR c)
  3612. #else
  3613. xl2l1(c) CHAR c;
  3614. #endif /* CK_ANSIC */
  3615. { /* xll2l1 */
  3616. return(yl2l1[c]);
  3617. }
  3618. CHAR
  3619. #ifdef CK_ANSIC
  3620. xl2w1(CHAR c)
  3621. #else
  3622. xl2w1(c) CHAR c;
  3623. #endif /* CK_ANSIC */
  3624. { /* xl2w1 */ /* Latin-2 to CP1252 (Windows L1) */
  3625. if (c > 127 && c < 160)
  3626. return(UNK);
  3627. else
  3628. return(yl2l1[c]);
  3629. }
  3630. CHAR /* Latin-1 to Latin-2 */
  3631. #ifdef CK_ANSIC
  3632. xl1l2(CHAR c)
  3633. #else
  3634. xl1l2(c) CHAR c;
  3635. #endif /* CK_ANSIC */
  3636. { /* xll1l2 */
  3637. return(yl1l2[c]);
  3638. }
  3639. CHAR /* CP1252 to Latin-1 */
  3640. #ifdef CK_ANSIC
  3641. xw1l2(CHAR c)
  3642. #else
  3643. xw1l2(c) CHAR c;
  3644. #endif /* CK_ANSIC */
  3645. { /* xw1l2 */
  3646. switch (c) {
  3647. case 0x8a: return(0xa9); /* S caron */
  3648. case 0x8e: return(0xae); /* Z caron */
  3649. case 0x9a: return(0xb9); /* s caron */
  3650. case 0x9e: return(0xbe); /* z caron */
  3651. default:
  3652. return((c < 160) ? xw1as(c) : xl1l2(c));
  3653. }
  3654. }
  3655. CHAR /* Latin-2 to ASCII */
  3656. #ifdef CK_ANSIC
  3657. xl2as(CHAR c)
  3658. #else
  3659. xl2as(c) CHAR c;
  3660. #endif /* CK_ANSIC */
  3661. { /* xll2as */
  3662. return(yl2as[c]);
  3663. }
  3664. CHAR /* Latin-2 to CP852 */
  3665. #ifdef CK_ANSIC
  3666. xl252(CHAR c)
  3667. #else
  3668. xl252(c) CHAR c;
  3669. #endif /* CK_ANSIC */
  3670. { /* xll252 */
  3671. return(yl252[c]);
  3672. }
  3673. CHAR /* Latin-2 to Mazovia */
  3674. #ifdef CK_ANSIC
  3675. xl2mz(CHAR c)
  3676. #else
  3677. xl2mz(c) CHAR c;
  3678. #endif /* CK_ANSIC */
  3679. { /* xll2mz */
  3680. return(yl2mz[c]);
  3681. }
  3682. CHAR /* Latin-1 to Mazovia */
  3683. #ifdef CK_ANSIC
  3684. xl1mz(CHAR c)
  3685. #else
  3686. xl1mz(c) CHAR c;
  3687. #endif /* CK_ANSIC */
  3688. { /* xll1mz */
  3689. return(yl2mz[yl1l2[c]]);
  3690. }
  3691. CHAR /* Mazovia to Latin-1 */
  3692. #ifdef CK_ANSIC
  3693. xmzl1(CHAR c)
  3694. #else
  3695. xmzl1(c) CHAR c;
  3696. #endif /* CK_ANSIC */
  3697. { /* xmzl1 */
  3698. return(yl2l1[ymzl2[c]]);
  3699. }
  3700. CHAR /* Mazovia to Latin-9 */
  3701. #ifdef CK_ANSIC
  3702. xmzl9(CHAR c)
  3703. #else
  3704. xmzl9(c) CHAR c;
  3705. #endif /* CK_ANSIC */
  3706. { /* xmzl9 */
  3707. return(xl2l9(ymzl2[c]));
  3708. }
  3709. CHAR /* CP852 to Latin-2 */
  3710. #ifdef CK_ANSIC
  3711. x52l2(CHAR c)
  3712. #else
  3713. x52l2(c) CHAR c;
  3714. #endif /* CK_ANSIC */
  3715. { /* x52l2 */
  3716. return(y52l2[c]);
  3717. }
  3718. CHAR /* Mazovia to Latin-2 */
  3719. #ifdef CK_ANSIC
  3720. xmzl2(CHAR c)
  3721. #else
  3722. xmzl2(c) CHAR c;
  3723. #endif /* CK_ANSIC */
  3724. { /* xmzl2 */
  3725. return(ymzl2[c]);
  3726. }
  3727. CHAR /* Latin-2 to CP1250 */
  3728. #ifdef CK_ANSIC
  3729. xl21250(CHAR c)
  3730. #else
  3731. xl21250(c) CHAR c;
  3732. #endif /* CK_ANSIC */
  3733. { /* xll21250 */
  3734. return(yl21250[c]);
  3735. }
  3736. CHAR /* CP1250 to Latin-2 */
  3737. #ifdef CK_ANSIC
  3738. x1250l2(CHAR c)
  3739. #else
  3740. x1250l2(c) CHAR c;
  3741. #endif /* CK_ANSIC */
  3742. { /* x1250l2 */
  3743. return(y1250l2[c]);
  3744. }
  3745. CHAR /* CP852 to ASCII */
  3746. #ifdef CK_ANSIC
  3747. x52as(CHAR c)
  3748. #else
  3749. x52as(c) CHAR c;
  3750. #endif /* CK_ANSIC */
  3751. { /* xl52as */
  3752. return(yl2as[y52l2[c]]); /* CP852 -> Latin-2 -> ASCII */
  3753. }
  3754. CHAR /* CP1250 to ASCII */
  3755. #ifdef CK_ANSIC
  3756. x1250as(CHAR c)
  3757. #else
  3758. x1250as(c) CHAR c;
  3759. #endif /* CK_ANSIC */
  3760. { /* xl1250as */
  3761. return(yl2as[y1250l2[c]]); /* CP81250 -> Latin-2 -> ASCII */
  3762. }
  3763. CHAR /* CP852 to Latin-1 */
  3764. #ifdef CK_ANSIC
  3765. x52l1(CHAR c)
  3766. #else
  3767. x52l1(c) CHAR c;
  3768. #endif /* CK_ANSIC */
  3769. { /* xl52l1 */
  3770. return(yl2l1[y52l2[c]]); /* CP852 -> Latin-2 -> Latin-1 */
  3771. }
  3772. CHAR /* CP1250 to Latin-1 */
  3773. #ifdef CK_ANSIC
  3774. x1250l1(CHAR c)
  3775. #else
  3776. x1250l1(c) CHAR c;
  3777. #endif /* CK_ANSIC */
  3778. { /* xl1250l1 */
  3779. return(yl2l1[y1250l2[c]]); /* CP1250 -> Latin-2 -> Latin-1 */
  3780. }
  3781. CHAR /* CP1250 to Latin-9 */
  3782. #ifdef CK_ANSIC
  3783. x1250l9(CHAR c)
  3784. #else
  3785. x1250l9(c) CHAR c;
  3786. #endif /* CK_ANSIC */
  3787. { /* x1250l9 */
  3788. if (c == (CHAR)128) /* Euro */
  3789. return((CHAR)164);
  3790. else
  3791. return(xl2l9(y1250l2[c])); /* CP1250 -> Latin-2 -> Latin-9 */
  3792. }
  3793. CHAR /* Latin-1 to CP852 */
  3794. #ifdef CK_ANSIC
  3795. xl152(CHAR c)
  3796. #else
  3797. xl152(c) CHAR c;
  3798. #endif /* CK_ANSIC */
  3799. { /* xll152 */
  3800. return(yl252[yl1l2[c]]); /* Latin-1 -> Latin-2 -> CP852 */
  3801. }
  3802. CHAR /* Latin-1 to CP1250 */
  3803. #ifdef CK_ANSIC
  3804. xl11250(CHAR c)
  3805. #else
  3806. xl11250(c) CHAR c;
  3807. #endif /* CK_ANSIC */
  3808. { /* xll11250 */
  3809. return(yl21250[yl1l2[c]]); /* Latin-1 -> Latin-2 -> CP1250 */
  3810. }
  3811. CHAR /* Latin-9 to CP1250 */
  3812. #ifdef CK_ANSIC
  3813. xl91250(CHAR c)
  3814. #else
  3815. xl91250(c) CHAR c;
  3816. #endif /* CK_ANSIC */
  3817. { /* xll91250 */
  3818. if (c == (CHAR)164) /* Euro */
  3819. return((CHAR)128);
  3820. else
  3821. return(yl21250[xl9l2(c)]); /* Latin-9 -> Latin-2 -> CP1250 */
  3822. }
  3823. CHAR /* Latin-9 to Mazovia */
  3824. #ifdef CK_ANSIC
  3825. xl9mz(CHAR c)
  3826. #else
  3827. xl9mz(c) CHAR c;
  3828. #endif /* CK_ANSIC */
  3829. { /* xll9mz */
  3830. return(yl2mz[xl9l2(c)]); /* Latin-9 -> Latin-2 -> Mazovia */
  3831. }
  3832. CHAR /* Latin-9 to Mazovia */
  3833. #ifdef CK_ANSIC
  3834. xmzas(CHAR c)
  3835. #else
  3836. xmzas(c) CHAR c;
  3837. #endif /* CK_ANSIC */
  3838. { /* xmzas */
  3839. return(yl2as[xmzl2(c)]); /* Mazovia -> Latin-2 -> ASCII */
  3840. }
  3841. CHAR /* Latin-2 to NeXT */
  3842. #ifdef CK_ANSIC
  3843. xl2ne(CHAR c)
  3844. #else
  3845. xl2ne(c) CHAR c;
  3846. #endif /* CK_ANSIC */
  3847. { /* xll2ne */
  3848. switch(c) {
  3849. case 162: return(198); /* Breve */
  3850. case 163: return(232); /* L with stroke */
  3851. case 178: return(206); /* Ogonek */
  3852. case 179: return(248); /* l with stroke */
  3853. case 183: return(207); /* Caron */
  3854. case 189: return(205); /* Double acute */
  3855. case 208: return(144); /* D stroke = Eth */
  3856. case 240: return(230); /* d stroke = eth */
  3857. case 255: return(199); /* Dot above */
  3858. default: return(yl1ne[yl2l1[c]]);
  3859. }
  3860. }
  3861. CHAR /* Latin-2 to CP437 */
  3862. #ifdef CK_ANSIC
  3863. xl243(CHAR c)
  3864. #else
  3865. xl243(c) CHAR c;
  3866. #endif /* CK_ANSIC */
  3867. { /* xll243 */
  3868. return(yl1l2[y43l1[c]]);
  3869. }
  3870. CHAR /* Latin-2 to CP850 */
  3871. #ifdef CK_ANSIC
  3872. xl285(CHAR c)
  3873. #else
  3874. xl285(c) CHAR c;
  3875. #endif /* CK_ANSIC */
  3876. { /* xll285 */
  3877. return(yl1l2[y85l1[c]]);
  3878. }
  3879. CHAR /* Latin-2 to Apple */
  3880. #ifdef CK_ANSIC
  3881. xl2aq(CHAR c)
  3882. #else
  3883. xl2aq(c) CHAR c;
  3884. #endif /* CK_ANSIC */
  3885. { /* xl2aq */
  3886. return(yl1aq[yl2l1[c]]); /* Could do more... */
  3887. }
  3888. CHAR /* Latin-2 to DGI */
  3889. #ifdef CK_ANSIC
  3890. xl2dg(CHAR c)
  3891. #else
  3892. xl2dg(c) CHAR c;
  3893. #endif /* CK_ANSIC */
  3894. { /* xll2dg */
  3895. return(ydgl1[yl1l2[c]]);
  3896. }
  3897. CHAR /* Latin-2 to Short KOI */
  3898. #ifdef CK_ANSIC
  3899. xl2sk(CHAR c)
  3900. #else
  3901. xl2sk(c) CHAR c;
  3902. #endif /* CK_ANSIC */
  3903. { /* xll2sk */
  3904. return(islower(c) ? toupper(c) : c);
  3905. }
  3906. CHAR /* NeXT to Latin-2 */
  3907. #ifdef CK_ANSIC
  3908. xnel2(CHAR c)
  3909. #else
  3910. xnel2(c) CHAR c;
  3911. #endif /* CK_ANSIC */
  3912. { /* xnel2 */
  3913. switch (c) {
  3914. case 144: return(208); /* D stroke = Eth */
  3915. case 198: return(162); /* Breve */
  3916. case 199: return(255); /* Dot above */
  3917. case 205: return(189); /* Double acute */
  3918. case 206: return(178); /* Ogonek */
  3919. case 207: return(183); /* Caron */
  3920. case 230: return(240); /* d stroke = eth */
  3921. case 232: return(163); /* L with stroke */
  3922. case 248: return(179); /* l with stroke */
  3923. default: return(yl1l2[ynel1[c]]); /* Others, go thru Latin-1 */
  3924. }
  3925. }
  3926. CHAR /* CP437 to Latin-2 */
  3927. #ifdef CK_ANSIC
  3928. x43l2(CHAR c)
  3929. #else
  3930. x43l2(c) CHAR c;
  3931. #endif /* CK_ANSIC */
  3932. { /* xl43l2 */
  3933. return(yl1l2[y43l1[c]]);
  3934. }
  3935. CHAR /* CP850 to Latin-2 */
  3936. #ifdef CK_ANSIC
  3937. x85l2(CHAR c)
  3938. #else
  3939. x85l2(c) CHAR c;
  3940. #endif /* CK_ANSIC */
  3941. { /* xl85l2 */
  3942. return(yl1l2[y85l1[c]]);
  3943. }
  3944. CHAR /* Apple to Latin-2 */
  3945. #ifdef CK_ANSIC
  3946. xaql2(CHAR c)
  3947. #else
  3948. xaql2(c) CHAR c;
  3949. #endif /* CK_ANSIC */
  3950. { /* xlaql2 */
  3951. switch (c) {
  3952. case 249: return(162); /* Breve accent */
  3953. case 250: return(255); /* Dot accent */
  3954. case 253: return(189); /* Double acute */
  3955. default: return(yl1l2[yaql1[c]]);
  3956. }
  3957. }
  3958. CHAR /* DGI to Latin-2 */
  3959. #ifdef CK_ANSIC
  3960. xdgl2(CHAR c)
  3961. #else
  3962. xdgl2(c) CHAR c;
  3963. #endif /* CK_ANSIC */
  3964. { /* xldgl2 */
  3965. return(yl1l2[ydgl1[c]]); /* (for now) */
  3966. }
  3967. CHAR /* Short KOI to Latin-2 */
  3968. #ifdef CK_ANSIC
  3969. xskl2(CHAR c)
  3970. #else
  3971. xskl2(c) CHAR c;
  3972. #endif /* CK_ANSIC */
  3973. { /* xlskl2 */
  3974. return(islower(c) ? toupper(c) : c);
  3975. }
  3976. CHAR /* Latin-2 to German */
  3977. #ifdef CK_ANSIC
  3978. xl2ge(CHAR c)
  3979. #else
  3980. xl2ge(c) CHAR c;
  3981. #endif /* CK_ANSIC */
  3982. { /* xll2ge */
  3983. switch(c) {
  3984. case 167: return(64); /* Paragraph sign */
  3985. case 196: return(91); /* A-diaeresis */
  3986. case 214: return(92); /* O-diaeresis */
  3987. case 220: return(93); /* U-diaeresis */
  3988. case 223: return(126); /* double-s */
  3989. case 228: return(123); /* a-diaeresis */
  3990. case 246: return(124); /* o-diaeresis */
  3991. case 252: return(125); /* u-diaeresis */
  3992. default: return(yl2as[c]); /* Others */
  3993. }
  3994. }
  3995. CHAR /* German to Latin-2 */
  3996. #ifdef CK_ANSIC
  3997. xgel2(CHAR c)
  3998. #else
  3999. xgel2(c) CHAR c;
  4000. #endif /* CK_ANSIC */
  4001. { /* xlgel2 */
  4002. if (c & 0x80)
  4003. return(UNK);
  4004. switch(c) {
  4005. case 64: return(167); /* Paragraph sign */
  4006. case 91: return(196); /* A-diaeresis */
  4007. case 92: return(214); /* O-diaeresis */
  4008. case 93: return(220); /* U-diaeresis */
  4009. case 123: return(228); /* a-diaeresis */
  4010. case 126: return(223); /* double-s */
  4011. case 124: return(246); /* o-diaeresis */
  4012. case 125: return(252); /* u-diaeresis */
  4013. default: return(c); /* Others */
  4014. }
  4015. }
  4016. CHAR /* Latin-2 to Hungarian */
  4017. #ifdef CK_ANSIC
  4018. xl2hu(CHAR c)
  4019. #else
  4020. xl2hu(c) CHAR c;
  4021. #endif /* CK_ANSIC */
  4022. { /* xll2hu */
  4023. switch(c) {
  4024. case 164: return(36); /* Currency symbol */
  4025. case 189: return(126); /* Double acute accent */
  4026. case 193: return(64); /* A-acute */
  4027. case 201: return(91); /* E-acute */
  4028. case 214: return(92); /* O-diaeresis */
  4029. case 220: return(93); /* U-diaeresis */
  4030. case 225: return(96); /* a-acute */
  4031. case 233: return(123); /* e-acute */
  4032. case 246: return(124); /* o-diaeresis */
  4033. case 252: return(125); /* u-diaeresis */
  4034. default: return(yl2as[c]); /* Others */
  4035. }
  4036. }
  4037. CHAR /* Hungarian to Latin-2 */
  4038. #ifdef CK_ANSIC
  4039. xhul2(CHAR c)
  4040. #else
  4041. xhul2(c) CHAR c;
  4042. #endif /* CK_ANSIC */
  4043. { /* xlhul2 */
  4044. if (c & 0x80)
  4045. return(UNK);
  4046. switch(c) {
  4047. case 36: return(164); /* Currency symbol */
  4048. case 64: return(193); /* A-acute */
  4049. case 91: return(201); /* E-acute */
  4050. case 92: return(214); /* O-diaeresis */
  4051. case 93: return(220); /* U-diaeresis */
  4052. case 96: return(225); /* a-acute */
  4053. case 123: return(233); /* e-acute */
  4054. case 124: return(246); /* o-diaeresis */
  4055. case 125: return(252); /* u-diaeresis */
  4056. case 126: return(189); /* Double acute accent */
  4057. default: return(c); /* Others */
  4058. }
  4059. }
  4060. CHAR
  4061. #ifdef CK_ANSIC
  4062. xr8l2(CHAR c)
  4063. #else
  4064. xr8l2(c) CHAR c;
  4065. #endif /* CK_ANSIC */
  4066. { /* xr8l2 */ /* Hewlett Packard Roman8 to Latin-2 */
  4067. switch (c) {
  4068. case 235: return(169); /* S caron */
  4069. case 236: return(185); /* s caron */
  4070. default: return(yl1l2[yr8l1[c]]);
  4071. }
  4072. }
  4073. CHAR
  4074. #ifdef CK_ANSIC
  4075. xl2r8(CHAR c)
  4076. #else
  4077. xl2r8(c) CHAR c;
  4078. #endif /* CK_ANSIC */
  4079. { /* xl2r8 */ /* Latin-2 to Hewlett Packard Roman8 Character Set */
  4080. switch (c) {
  4081. case 169: return(235); /* S caron */
  4082. case 185: return(236); /* s caron */
  4083. default: return(yr8l1[yl1l2[c]]);
  4084. }
  4085. }
  4086. #else /* NOLATIN2 */
  4087. #define xl1mz NULL
  4088. #define xmzl1 NULL
  4089. #define xl2mz NULL
  4090. #define xmzl2 NULL
  4091. #define xl9mz NULL
  4092. #define xmzl9 NULL
  4093. #define xmzas NULL
  4094. #define xl11250 NULL
  4095. #define xl21250 NULL
  4096. #define xl91250 NULL
  4097. #define x1250as NULL
  4098. #define x1250l1 NULL
  4099. #define x1250l2 NULL
  4100. #define x1250l9 NULL
  4101. #define xl2l1 NULL
  4102. #define xl2w1 NULL
  4103. #define xl1l2 NULL
  4104. #define xw1l2 NULL
  4105. #define xl2as NULL
  4106. #define xl252 NULL
  4107. #define x52l2 NULL
  4108. #define x52as NULL
  4109. #define x52l1 NULL
  4110. #define xl152 NULL
  4111. #define xl2ne NULL
  4112. #define xl243 NULL
  4113. #define xl285 NULL
  4114. #define xl2aq NULL
  4115. #define xl2dg NULL
  4116. #define xl2sk NULL
  4117. #define xnel2 NULL
  4118. #define x43l2 NULL
  4119. #define x85l2 NULL
  4120. #define xaql2 NULL
  4121. #define xdgl2 NULL
  4122. #define xskl2 NULL
  4123. #define xl2ge NULL
  4124. #define xgel2 NULL
  4125. #define xl2hu NULL
  4126. #define xhul2 NULL
  4127. #define xl2r8 NULL
  4128. #define xr8l2 NULL
  4129. #endif /* LATIN2 */
  4130. /* This one can also be used for ELOT 927, Hebrew 7, etc */
  4131. CHAR
  4132. #ifdef CK_ANSIC
  4133. xassk(CHAR c)
  4134. #else
  4135. xassk(c) CHAR c;
  4136. #endif /* CK_ANSIC */
  4137. { /* xassk */ /* ASCII to Short KOI */
  4138. if (c & 0x80)
  4139. return(UNK);
  4140. return((c > 95) ? (c - 32) : c); /* Fold columns 6-7 to 4-5 */
  4141. }
  4142. #ifdef CYRILLIC
  4143. /* Translation functions for Cyrillic character sets */
  4144. CHAR /* Latin/Cyrillic to CP866 */
  4145. #ifdef CK_ANSIC
  4146. xlcac(CHAR c)
  4147. #else
  4148. xlcac(c) CHAR c;
  4149. #endif /* CK_ANSIC */
  4150. { /* xlcac */ /* PC Code Page 866 */
  4151. return(ylcac[c]);
  4152. }
  4153. CHAR /* Latin/Cyrillic to */
  4154. #ifdef CK_ANSIC
  4155. xlc55(CHAR c)
  4156. #else
  4157. xlc55(c) CHAR c;
  4158. #endif /* CK_ANSIC */
  4159. { /* xlc55 */ /* PC Code Page 855 */
  4160. return(ylc55[c]);
  4161. }
  4162. CHAR /* Latin/Cyrillic to */
  4163. #ifdef CK_ANSIC
  4164. xlc1251(CHAR c)
  4165. #else
  4166. xlc1251(c) CHAR c;
  4167. #endif /* CK_ANSIC */
  4168. { /* xlc1251 */ /* PC Code Page 1251 */
  4169. return(ylc1251[c]);
  4170. }
  4171. CHAR /* Latin/Cyrillic to... */
  4172. #ifdef CK_ANSIC
  4173. xlcbu(CHAR c)
  4174. #else
  4175. xlcbu(c) CHAR c;
  4176. #endif /* CK_ANSIC */
  4177. { /* xlcbu */ /* Bulgarian PC Code Page */
  4178. return(ylcbu[c]);
  4179. }
  4180. CHAR /* Latin/Cyrillic to Old KOI-8 */
  4181. #ifdef CK_ANSIC
  4182. xlck8(CHAR c)
  4183. #else
  4184. xlck8(c) CHAR c;
  4185. #endif /* CK_ANSIC */
  4186. { /* xlck8 */
  4187. return(ylck8[c]);
  4188. }
  4189. CHAR /* Latin/Cyrillic to KOI8-R */
  4190. #ifdef CK_ANSIC
  4191. xlckr(CHAR c)
  4192. #else
  4193. xlckr(c) CHAR c;
  4194. #endif /* CK_ANSIC */
  4195. { /* xlckr */
  4196. switch(c) {
  4197. case 0xa1: return(0xb3); /* Io */
  4198. case 0xf1: return(0xa3); /* io */
  4199. default:
  4200. if (c > 0x7f && c < 0xc0)
  4201. return(UNK);
  4202. return(ylck8[c]);
  4203. }
  4204. }
  4205. CHAR /* Latin/Cyrillic to KOI8-U */
  4206. #ifdef CK_ANSIC
  4207. xlcku(CHAR c)
  4208. #else
  4209. xlcku(c) CHAR c;
  4210. #endif /* CK_ANSIC */
  4211. { /* xlcku */
  4212. switch(c) {
  4213. case 0xa1: return(0xb3); /* Io */
  4214. case 0xf1: return(0xa3); /* io */
  4215. case 0xf4: return(0xa4); /* Ukrainian ie */
  4216. case 0xf6: return(0xa6); /* Ukrainian i */
  4217. case 0xf7: return(0xa7); /* Ukrainian yi */
  4218. case 0xf3: return(0xad); /* Ukrainian ghe with upturn */
  4219. case 0xa4: return(0xb4); /* Ukrainian Ie */
  4220. case 0xa6: return(0xb6); /* Ukrainian I */
  4221. case 0xa7: return(0xb7); /* Ukrainian Yi */
  4222. case 0xa3: return(0xbd); /* Ukrainian Ghe with upturn */
  4223. default:
  4224. if (c > 0x7f && c < 0xc0)
  4225. return(UNK);
  4226. return(ylck8[c]);
  4227. }
  4228. }
  4229. CHAR
  4230. #ifdef CK_ANSIC
  4231. xlcsk(CHAR c)
  4232. #else
  4233. xlcsk(c) CHAR c;
  4234. #endif /* CK_ANSIC */
  4235. { /* xlcsk */ /* Latin/Cyrillic to Short KOI */
  4236. return(ylcsk[c]);
  4237. }
  4238. CHAR
  4239. #ifdef CK_ANSIC
  4240. xlcas(CHAR c)
  4241. #else
  4242. xlcas(c) CHAR c;
  4243. #endif /* CK_ANSIC */
  4244. { /* xlcas */ /* Latin/Cyrillic to ASCII */
  4245. if (langs[language].id == L_RUSSIAN)
  4246. return(ylcsk[c]);
  4247. else
  4248. return((c > 127) ? '?' : c);
  4249. }
  4250. CHAR /* CP866 */
  4251. #ifdef CK_ANSIC
  4252. xaclc(CHAR c)
  4253. #else
  4254. xaclc(c) CHAR c;
  4255. #endif /* CK_ANSIC */
  4256. { /* xaclc */ /* to Latin/Cyrillic */
  4257. return(yaclc[c]);
  4258. }
  4259. CHAR /* CP855 */
  4260. #ifdef CK_ANSIC
  4261. x55lc(CHAR c)
  4262. #else
  4263. x55lc(c) CHAR c;
  4264. #endif /* CK_ANSIC */
  4265. { /* x55lc */ /* to Latin/Cyrillic */
  4266. return(y55lc[c]);
  4267. }
  4268. CHAR /* Bulgarian PC Code Page ... */
  4269. #ifdef CK_ANSIC
  4270. xbulc(CHAR c)
  4271. #else
  4272. xbulc(c) CHAR c;
  4273. #endif /* CK_ANSIC */
  4274. { /* xbulc */ /* to Latin/Cyrillic */
  4275. return(ybulc[c]);
  4276. }
  4277. CHAR /* CP1251 */
  4278. #ifdef CK_ANSIC
  4279. x1251lc(CHAR c)
  4280. #else
  4281. x1251lc(c) CHAR c;
  4282. #endif /* CK_ANSIC */
  4283. { /* x1251lc */ /* to Latin/Cyrillic */
  4284. return(y1251lc[c]);
  4285. }
  4286. CHAR /* Old KOI-8 to Latin/Cyrillic */
  4287. #ifdef CK_ANSIC
  4288. xk8lc(CHAR c)
  4289. #else
  4290. xk8lc(c) CHAR c;
  4291. #endif /* CK_ANSIC */
  4292. { /* xk8lc */
  4293. return(yk8lc[c]);
  4294. }
  4295. CHAR /* KOI8-R to Latin/Cyrillic */
  4296. #ifdef CK_ANSIC
  4297. xkrlc(CHAR c)
  4298. #else
  4299. xkrlc(c) CHAR c;
  4300. #endif /* CK_ANSIC */
  4301. { /* xkrlc */
  4302. if (c == 0xb3) return(0xa1);
  4303. else if (c == 0xa3) return(0xf1);
  4304. else if (c > 0x7f && c < 0xc0)
  4305. return(UNK);
  4306. return(yk8lc[c]);
  4307. }
  4308. CHAR /* KOI8-U to Latin/Cyrillic */
  4309. #ifdef CK_ANSIC
  4310. xkulc(CHAR c)
  4311. #else
  4312. xkulc(c) CHAR c;
  4313. #endif /* CK_ANSIC */
  4314. { /* xkulc */
  4315. switch (c) {
  4316. case 0xb3: return(0xa1); /* Io */
  4317. case 0xa3: return(0xf1); /* io */
  4318. case 0xa4: return(0xf4); /* Ukrainian ie */
  4319. case 0xa6: return(0xf6); /* Ukrainian i */
  4320. case 0xa7: return(0xf7); /* Ukrainian yi */
  4321. case 0xad: return(0xf3); /* Ukrainian ghe with upturn */
  4322. case 0xb4: return(0xa4); /* Ukrainian Ie */
  4323. case 0xb6: return(0xa6); /* Ukrainian I */
  4324. case 0xb7: return(0xa7); /* Ukrainian Yi */
  4325. case 0xbd: return(0xa3); /* Ukrainian Ghe with upturn */
  4326. /* Note substitution of Gje for Ghe-Upturn, which is not in 8859-5 */
  4327. default:
  4328. if (c > 0x7f && c < 0xc0)
  4329. return(UNK);
  4330. return(yk8lc[c]);
  4331. }
  4332. }
  4333. CHAR
  4334. #ifdef CK_ANSIC
  4335. xskcy(CHAR c)
  4336. #else
  4337. xskcy(c) CHAR c;
  4338. #endif /* CK_ANSIC */
  4339. { /* xskcy */ /* Short KOI to Latin/Cyrillic */
  4340. return(yskcy[c & 0x7f]);
  4341. }
  4342. CHAR
  4343. #ifdef CK_ANSIC
  4344. xascy(CHAR c)
  4345. #else
  4346. xascy(c) CHAR c;
  4347. #endif /* CK_ANSIC */
  4348. { /* xascy */ /* ASCII to Latin/Cyrillic */
  4349. if (langs[language].id == L_RUSSIAN) { /* If LANGUAGE == RUSSIAN */
  4350. return(yskcy[c & 0x7f]); /* treat ASCII as Short KOI */
  4351. } else return((c > 127) ? '?' : c);
  4352. }
  4353. CHAR
  4354. #ifdef CK_ANSIC
  4355. xacas(CHAR c)
  4356. #else
  4357. xacas(c) CHAR c;
  4358. #endif /* CK_ANSIC */
  4359. { /* xacas */ /* CP866 to ASCII */
  4360. if (langs[language].id == L_RUSSIAN) {
  4361. c = yaclc[c]; /* First to Latin/Cyrillic */
  4362. return(ylcsk[c]); /* Then to Short KOI */
  4363. } else return((c > 127) ? '?' : c);
  4364. }
  4365. CHAR
  4366. #ifdef CK_ANSIC
  4367. x55as(CHAR c)
  4368. #else
  4369. x55as(c) CHAR c;
  4370. #endif /* CK_ANSIC */
  4371. { /* x55as */ /* CP855 to ASCII */
  4372. if (langs[language].id == L_RUSSIAN) {
  4373. c = y55lc[c]; /* First to Latin/Cyrillic */
  4374. return(ylcsk[c]); /* Then to Short KOI */
  4375. } else return((c > 127) ? '?' : c);
  4376. }
  4377. CHAR
  4378. #ifdef CK_ANSIC
  4379. x1251as(CHAR c)
  4380. #else
  4381. x1251as(c) CHAR c;
  4382. #endif /* CK_ANSIC */
  4383. { /* x1251as */ /* CP81251 to ASCII */
  4384. if (langs[language].id == L_RUSSIAN) {
  4385. c = y1251lc[c]; /* First to Latin/Cyrillic */
  4386. return(ylcsk[c]); /* Then to Short KOI */
  4387. } else return((c > 127) ? '?' : c);
  4388. }
  4389. CHAR
  4390. #ifdef CK_ANSIC
  4391. xskas(CHAR c)
  4392. #else
  4393. xskas(c) CHAR c;
  4394. #endif /* CK_ANSIC */
  4395. { /* xskas */ /* Short KOI to ASCII */
  4396. return((c > 95) ? '?' : c);
  4397. }
  4398. CHAR
  4399. #ifdef CK_ANSIC
  4400. xk8as(CHAR c)
  4401. #else
  4402. xk8as(c) CHAR c;
  4403. #endif /* CK_ANSIC */
  4404. { /* xk8as */ /* Old KOI-8 Cyrillic to ASCII */
  4405. if (langs[language].id == L_RUSSIAN) {
  4406. c = yk8lc[c]; /* First to Latin/Cyrillic */
  4407. return(ylcsk[c]); /* Then to Short KOI */
  4408. } else return((c > 127) ? '?' : c);
  4409. }
  4410. CHAR
  4411. #ifdef CK_ANSIC
  4412. xl1sk(CHAR c)
  4413. #else
  4414. xl1sk(c) CHAR c;
  4415. #endif /* CK_ANSIC */
  4416. { /* xl1sk */ /* Latin-1 to Short KOI */
  4417. c = zl1as(c); /* Convert to ASCII */
  4418. return(c = xassk(c)); /* Convert ASCII to Short KOI */
  4419. }
  4420. CHAR
  4421. #ifdef CK_ANSIC
  4422. xw1lc(CHAR c)
  4423. #else
  4424. xw1lc(c) CHAR c;
  4425. #endif /* CK_ANSIC */
  4426. { /* xw1lc */ /* CP1252 to Latin/Cyrillic */
  4427. return((c < 160) ? xw1as(c) : zl1as(c));
  4428. }
  4429. CHAR
  4430. #ifdef CK_ANSIC
  4431. xaslc(CHAR c)
  4432. #else
  4433. xaslc(c) CHAR c;
  4434. #endif /* CK_ANSIC */
  4435. { /* xaslc */ /* ASCII to Latin/Cyrillic */
  4436. if (langs[language].id == L_RUSSIAN)
  4437. return(yskcy[c & 0x7f]);
  4438. else return(c & 0x7f);
  4439. }
  4440. CHAR
  4441. #ifdef CK_ANSIC
  4442. xasac(CHAR c)
  4443. #else
  4444. xasac(c) CHAR c;
  4445. #endif /* CK_ANSIC */
  4446. { /* xasac */ /* ASCII to CP866 */
  4447. if (c & 0x80)
  4448. return(UNK);
  4449. if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  4450. c = xskcy(c); /* Translate to Latin/Cyrillic */
  4451. return(ylcac[c]); /* Then to CP866 */
  4452. } else return(c & 0x7f);
  4453. }
  4454. CHAR
  4455. #ifdef CK_ANSIC
  4456. xas55(CHAR c)
  4457. #else
  4458. xas55(c) CHAR c;
  4459. #endif /* CK_ANSIC */
  4460. { /* xas55 */ /* ASCII to CP855 */
  4461. if (c & 0x80)
  4462. return(UNK);
  4463. if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  4464. c = xskcy(c); /* Translate to Latin/Cyrillic */
  4465. return(ylc55[c]); /* Then to CP866 */
  4466. } else return(c & 0x7f);
  4467. }
  4468. CHAR
  4469. #ifdef CK_ANSIC
  4470. xas1251(CHAR c)
  4471. #else
  4472. xas1251(c) CHAR c;
  4473. #endif /* CK_ANSIC */
  4474. { /* xas1251 */ /* ASCII to CP81251 */
  4475. if (c & 0x80)
  4476. return(UNK);
  4477. if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  4478. c = xskcy(c); /* Translate to Latin/Cyrillic */
  4479. return(ylc1251[c]); /* Then to CP866 */
  4480. } else return(c & 0x7f);
  4481. }
  4482. CHAR
  4483. #ifdef CK_ANSIC
  4484. xask8(CHAR c)
  4485. #else
  4486. xask8(c) CHAR c;
  4487. #endif /* CK_ANSIC */
  4488. { /* xask8 */ /* ASCII to KOI-8 */
  4489. if (c & 0x80)
  4490. return(UNK);
  4491. if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  4492. c = xskcy(c); /* Translate to Latin/Cyrillic */
  4493. return(ylck8[c]); /* Then to KOI-8 */
  4494. } else return(c & 0x7f);
  4495. }
  4496. #else /* No Cyrillic */
  4497. #define xacas NULL
  4498. #define x55as NULL
  4499. #define x1251as NULL
  4500. #define xaclc NULL
  4501. #define x55lc NULL
  4502. #define x1251lc NULL
  4503. #define xasac NULL
  4504. #define xas55 NULL
  4505. #define xas1251 NULL
  4506. #define xascy NULL
  4507. #define xask8 NULL
  4508. #define xaslc NULL
  4509. #define xassk NULL
  4510. #define xk8as NULL
  4511. #define xk8lc NULL
  4512. #define xkrlc NULL
  4513. #define xkulc NULL
  4514. #define xl1sk NULL
  4515. #define xw1lc NULL
  4516. #define xlcac NULL
  4517. #define xlc55 NULL
  4518. #define xlc1251 NULL
  4519. #define xlcas NULL
  4520. #define xlck8 NULL
  4521. #define xlckr NULL
  4522. #define xlcku NULL
  4523. #define xlch7 NULL
  4524. #define xlcsk NULL
  4525. #define xskas NULL
  4526. #define xskcy NULL
  4527. #define xbulc NULL
  4528. #define xlcbu NULL
  4529. #endif /* CYRILLIC */
  4530. /* Translation functions for Hebrew character sets */
  4531. #ifdef HEBREW
  4532. CHAR
  4533. #ifdef CK_ANSIC
  4534. xash7(CHAR c)
  4535. #else
  4536. xash7(c) CHAR c;
  4537. #endif /* CK_ANSIC */
  4538. { /* xash7 */ /* ASCII to Hebrew-7 */
  4539. if (c & 0x80)
  4540. return(UNK);
  4541. if (c == 96) return('?');
  4542. if (c > 96 && c < 123) return(c - 32);
  4543. else return(c);
  4544. }
  4545. CHAR
  4546. #ifdef CK_ANSIC
  4547. xl1h7(CHAR c)
  4548. #else
  4549. xl1h7(c) CHAR c;
  4550. #endif /* CK_ANSIC */
  4551. { /* xl1h7 */ /* Latin-1 to Hebrew-7 */
  4552. return(xash7(xl1as(c)));
  4553. }
  4554. CHAR
  4555. #ifdef CK_ANSIC
  4556. xl1lh(CHAR c)
  4557. #else
  4558. xl1lh(c) CHAR c;
  4559. #endif /* CK_ANSIC */
  4560. { /* xl1lh */ /* Latin-1 to Latin/Hebrew */
  4561. switch(c) {
  4562. case 170: return('a'); /* Feminine ordinal */
  4563. case 186: return('o'); /* Masculine ordinal */
  4564. case 215: return(170); /* Times */
  4565. case 247: return(186); /* Divide */
  4566. default: return( (c > 190) ? xl1as(c) : c );
  4567. }
  4568. }
  4569. CHAR
  4570. #ifdef CK_ANSIC
  4571. xw1lh(CHAR c)
  4572. #else
  4573. xw1lh(c) CHAR c;
  4574. #endif /* CK_ANSIC */
  4575. { /* xw1lh */ /* CP1252 to Latin/Hebrew */
  4576. switch(c) {
  4577. case 170: return('a'); /* Feminine ordinal */
  4578. case 186: return('o'); /* Masculine ordinal */
  4579. case 215: return(170); /* Times */
  4580. case 247: return(186); /* Divide */
  4581. default:
  4582. if (c < 160)
  4583. return(xw1as(c));
  4584. else
  4585. return((c > 190) ? xl1as(c) : c);
  4586. }
  4587. }
  4588. #ifdef LATIN2
  4589. CHAR
  4590. #ifdef CK_ANSIC
  4591. xl2h7(CHAR c)
  4592. #else
  4593. xl2h7(c) CHAR c;
  4594. #endif /* CK_ANSIC */
  4595. { /* xl2h7 */ /* Latin-2 to Hebrew-7 */
  4596. return(xash7(xl2as(c)));
  4597. }
  4598. #else
  4599. #define xl2h7 NULL
  4600. #endif /* LATIN2 */
  4601. #ifndef NOCYRIL
  4602. CHAR
  4603. #ifdef CK_ANSIC
  4604. xlch7(CHAR c)
  4605. #else
  4606. xlch7(c) CHAR c;
  4607. #endif /* CK_ANSIC */
  4608. { /* xlch7 */ /* Latin/Cyrillic to Hebrew-7 */
  4609. return(xash7(xlcas(c)));
  4610. }
  4611. #endif /* NOCYRIL */
  4612. CHAR
  4613. #ifdef CK_ANSIC
  4614. xlhas(CHAR c)
  4615. #else
  4616. xlhas(c) CHAR c;
  4617. #endif /* CK_ANSIC */
  4618. { /* xlhas */ /* Latin/Hebrew to ASCII */
  4619. return( (c > 127) ? '?' : c );
  4620. }
  4621. CHAR
  4622. #ifdef CK_ANSIC
  4623. xlhl1(CHAR c)
  4624. #else
  4625. xlhl1(c) CHAR c;
  4626. #endif /* CK_ANSIC */
  4627. { /* xlhl1 */ /* Latin/Hebrew to Latin-1 */
  4628. switch (c) {
  4629. case 170: return(215);
  4630. case 186: return(247);
  4631. default: return( (c > 190) ? '?' : c );
  4632. }
  4633. }
  4634. CHAR
  4635. #ifdef CK_ANSIC
  4636. xlhw1(CHAR c)
  4637. #else
  4638. xlhw1(c) CHAR c;
  4639. #endif /* CK_ANSIC */
  4640. { /* xlhw1 */ /* Latin/Hebrew to CP1252 */
  4641. if (c > 127 && c < 160)
  4642. return('?');
  4643. switch (c) {
  4644. case 170: return(215);
  4645. case 186: return(247);
  4646. default: return( (c > 190) ? '?' : c );
  4647. }
  4648. }
  4649. CHAR
  4650. #ifdef CK_ANSIC
  4651. xlh62(CHAR c)
  4652. #else
  4653. xlh62(c) CHAR c;
  4654. #endif /* CK_ANSIC */
  4655. { /* xlh62 */ /* Latin/Hebrew to CP862 */
  4656. return(ylh62[c]);
  4657. }
  4658. CHAR
  4659. #ifdef CK_ANSIC
  4660. xl162(CHAR c)
  4661. #else
  4662. xl162(c) CHAR c;
  4663. #endif /* CK_ANSIC */
  4664. { /* xl162 */ /* Latin-1 to CP862 */
  4665. return(xlh62(xl1lh(c))); /* Via Latin/Hebrew */
  4666. }
  4667. CHAR
  4668. #ifdef CK_ANSIC
  4669. xlhh7(CHAR c)
  4670. #else
  4671. xlhh7(c) CHAR c;
  4672. #endif /* CK_ANSIC */
  4673. { /* xlhh7 */ /* Latin/Hebrew to Hebrew-7 */
  4674. return(ylhh7[c]);
  4675. }
  4676. CHAR
  4677. #ifdef CK_ANSIC
  4678. xh7as(CHAR c)
  4679. #else
  4680. xh7as(c) CHAR c;
  4681. #endif /* CK_ANSIC */
  4682. { /* xh7as */ /* Hebrew-7 to ASCII */
  4683. if (c & 0x80)
  4684. return(UNK);
  4685. return( (c > 95 && c < 123) ? '?' : c );
  4686. }
  4687. CHAR
  4688. #ifdef CK_ANSIC
  4689. x62lh(CHAR c)
  4690. #else
  4691. x62lh(c) CHAR c;
  4692. #endif /* CK_ANSIC */
  4693. { /* x62lh */ /* CP862 to Latin/Hebrew */
  4694. return(y62lh[c]);
  4695. }
  4696. CHAR
  4697. #ifdef CK_ANSIC
  4698. x62as(CHAR c)
  4699. #else
  4700. x62as(c) CHAR c;
  4701. #endif /* CK_ANSIC */
  4702. { /* x62as */ /* CP862 to ASCII */
  4703. return( xlhas(x62lh(c)) );
  4704. }
  4705. CHAR
  4706. #ifdef CK_ANSIC
  4707. x62l1(CHAR c)
  4708. #else
  4709. x62l1(c) CHAR c;
  4710. #endif /* CK_ANSIC */
  4711. { /* x62l1 */ /* CP862 to Latin-1 */
  4712. return( xlhl1(x62lh(c)) );
  4713. }
  4714. CHAR
  4715. #ifdef CK_ANSIC
  4716. xh7lh(CHAR c)
  4717. #else
  4718. xh7lh(c) CHAR c;
  4719. #endif /* CK_ANSIC */
  4720. { /* xh7lh */ /* Hebrew-7 to Latin/Hebrew */
  4721. if (c & 0x80)
  4722. return(UNK);
  4723. return(yh7lh[c]);
  4724. }
  4725. #else /* No Hebrew */
  4726. #define xash7 NULL
  4727. #define xl1h7 NULL
  4728. #define xl2h7 NULL
  4729. #define xlch7 NULL
  4730. #define xl1lh NULL
  4731. #define xw1lh NULL
  4732. #define xlhas NULL
  4733. #define xlhl1 NULL
  4734. #define xlhw1 NULL
  4735. #define xl162 NULL
  4736. #define xlhh7 NULL
  4737. #define xlh62 NULL
  4738. #define xh7as NULL
  4739. #define x62as NULL
  4740. #define x62l1 NULL
  4741. #define xh7lh NULL
  4742. #define x62lh NULL
  4743. #endif /* HEBREW */
  4744. /* Translation functions for Greek character sets */
  4745. #ifdef GREEK
  4746. CHAR
  4747. #ifdef CK_ANSIC
  4748. xaseg(CHAR c)
  4749. #else
  4750. xaseg(c) CHAR c;
  4751. #endif /* CK_ANSIC */
  4752. { /* xaseg */ /* ASCII to ELOT 927 */
  4753. if (c & 0x80)
  4754. return(UNK);
  4755. if (c > 96 && c < 123) return(c - 32);
  4756. else return(c);
  4757. }
  4758. CHAR
  4759. #ifdef CK_ANSIC
  4760. xl1eg(CHAR c)
  4761. #else
  4762. xl1eg(c) CHAR c;
  4763. #endif /* CK_ANSIC */
  4764. { /* xl1ge */ /* Latin-1 to ELOT 927 */
  4765. return(xaseg(xl1as(c)));
  4766. }
  4767. CHAR
  4768. #ifdef CK_ANSIC
  4769. xl2lg(CHAR c)
  4770. #else
  4771. xl2lg(c) CHAR c;
  4772. #endif /* CK_ANSIC */
  4773. { /* xl2lg */ /* Latin-1 to Latin/Greek */
  4774. if (c < 160) return(c);
  4775. else if (c == 160 || c == 168 || c == 173 || c == 174)
  4776. return(c);
  4777. else return('?');
  4778. }
  4779. CHAR
  4780. #ifdef CK_ANSIC
  4781. xl1lg(CHAR c)
  4782. #else
  4783. xl1lg(c) CHAR c;
  4784. #endif /* CK_ANSIC */
  4785. { /* xl1lg */ /* Latin-1 to Latin/Greek */
  4786. if (c < 160) return(c);
  4787. switch(c) {
  4788. case 160: /* Themselves */
  4789. case 164:
  4790. case 166:
  4791. case 167:
  4792. case 168:
  4793. case 169:
  4794. case 171:
  4795. case 172:
  4796. case 173:
  4797. case 176:
  4798. case 177:
  4799. case 178:
  4800. case 179:
  4801. case 180:
  4802. case 187:
  4803. case 189:
  4804. return(c);
  4805. case 181: /* Lowercase mu */
  4806. return(236);
  4807. default:
  4808. return(UNK);
  4809. }
  4810. }
  4811. CHAR
  4812. #ifdef CK_ANSIC
  4813. xw1lg(CHAR c)
  4814. #else
  4815. xw1lg(c) CHAR c;
  4816. #endif /* CK_ANSIC */
  4817. { /* xw1lg */ /* CP1252 to Latin/Greek */
  4818. return((c < 160) ? xw1as(c) : xl1lg(c));
  4819. }
  4820. #ifdef LATIN2
  4821. CHAR
  4822. #ifdef CK_ANSIC
  4823. xl2eg(CHAR c)
  4824. #else
  4825. xl2eg(c) CHAR c;
  4826. #endif /* CK_ANSIC */
  4827. { /* xl2eg */ /* Latin-2 to ELOT 927 */
  4828. return(xaseg(xl2as(c)));
  4829. }
  4830. #else
  4831. #define xl2eg NULL
  4832. #endif /* LATIN2 */
  4833. #ifndef NOCYRIL
  4834. CHAR
  4835. #ifdef CK_ANSIC
  4836. xlceg(CHAR c)
  4837. #else
  4838. xlceg(c) CHAR c;
  4839. #endif /* CK_ANSIC */
  4840. { /* xlceg */ /* Latin/Cyrillic to ELOT 927 */
  4841. return(xaseg(xlcas(c)));
  4842. }
  4843. #endif /* NOCYRIL */
  4844. CHAR
  4845. #ifdef CK_ANSIC
  4846. xlgas(CHAR c)
  4847. #else
  4848. xlgas(c) CHAR c;
  4849. #endif /* CK_ANSIC */
  4850. { /* xlgas */ /* Latin/Greek to ASCII */
  4851. return( (c > 127) ? '?' : c );
  4852. }
  4853. CHAR
  4854. #ifdef CK_ANSIC
  4855. xlgl1(CHAR c)
  4856. #else
  4857. xlgl1(c) CHAR c;
  4858. #endif /* CK_ANSIC */
  4859. { /* xlgl1 */ /* Latin/Greek to Latin-1 */
  4860. if (c == 236)
  4861. return(181);
  4862. else
  4863. return(xl1lg(c));
  4864. }
  4865. CHAR
  4866. #ifdef CK_ANSIC
  4867. xlgw1(CHAR c)
  4868. #else
  4869. xlgw1(c) CHAR c;
  4870. #endif /* CK_ANSIC */
  4871. { /* xlgw1 */ /* Latin/Greek to Latin-1 */
  4872. if (c > 127 && c < 160)
  4873. return('?');
  4874. return(xlgl1(c));
  4875. }
  4876. CHAR
  4877. #ifdef CK_ANSIC
  4878. xlg69(CHAR c)
  4879. #else
  4880. xlg69(c) CHAR c;
  4881. #endif /* CK_ANSIC */
  4882. { /* xlg69 */ /* Latin/Greek to CP869 */
  4883. return(ylg69[c]);
  4884. }
  4885. CHAR
  4886. #ifdef CK_ANSIC
  4887. xl169(CHAR c)
  4888. #else
  4889. xl169(c) CHAR c;
  4890. #endif /* CK_ANSIC */
  4891. { /* xl169 */ /* Latin-1 to CP869 */
  4892. return(xlg69(xl1lg(c))); /* Via Latin/Greek */
  4893. }
  4894. CHAR
  4895. #ifdef CK_ANSIC
  4896. xlgeg(CHAR c)
  4897. #else
  4898. xlgeg(c) CHAR c;
  4899. #endif /* CK_ANSIC */
  4900. { /* xlgeg */ /* Latin/Greek to ELOT 927 */
  4901. return(ylgeg[c]);
  4902. }
  4903. CHAR
  4904. #ifdef CK_ANSIC
  4905. xegas(CHAR c)
  4906. #else
  4907. xegas(c) CHAR c;
  4908. #endif /* CK_ANSIC */
  4909. { /* xegas */ /* ELOT 927 to ASCII */
  4910. if (c & 0x80)
  4911. return(UNK);
  4912. return( (c > 96 && c < 123) ? '?' : c );
  4913. }
  4914. CHAR
  4915. #ifdef CK_ANSIC
  4916. x69lg(CHAR c)
  4917. #else
  4918. x69lg(c) CHAR c;
  4919. #endif /* CK_ANSIC */
  4920. { /* x69lg */ /* CP869 to Latin/Greek */
  4921. return(y69lg[c]);
  4922. }
  4923. CHAR
  4924. #ifdef CK_ANSIC
  4925. x69as(CHAR c)
  4926. #else
  4927. x69as(c) CHAR c;
  4928. #endif /* CK_ANSIC */
  4929. { /* x69as */ /* CP869 to ASCII */
  4930. return( xlgas(x69lg(c)) );
  4931. }
  4932. CHAR
  4933. #ifdef CK_ANSIC
  4934. x69l1(CHAR c)
  4935. #else
  4936. x69l1(c) CHAR c;
  4937. #endif /* CK_ANSIC */
  4938. { /* x69l1 */ /* CP869 to Latin-1 */
  4939. return( xlgl1(x69lg(c)) );
  4940. }
  4941. CHAR
  4942. #ifdef CK_ANSIC
  4943. xeglg(CHAR c)
  4944. #else
  4945. xeglg(c) CHAR c;
  4946. #endif /* CK_ANSIC */
  4947. { /* xeglg */ /* ELOT 927 to Latin/Greek */
  4948. return(yeglg[c]);
  4949. }
  4950. #else /* No Greek */
  4951. #define x69as NULL
  4952. #define x69l1 NULL
  4953. #define x69lg NULL
  4954. #define xaseg NULL
  4955. #define xegas NULL
  4956. #define xeglg NULL
  4957. #define xl169 NULL
  4958. #define xl1eg NULL
  4959. #define xl1lg NULL
  4960. #define xw1lg NULL
  4961. #define xl2ge NULL
  4962. #define xl2lg NULL
  4963. #define xlcge NULL
  4964. #define xlg69 NULL
  4965. #define xlgas NULL
  4966. #define xlgeg NULL
  4967. #define xlgge NULL
  4968. #define xlgl1 NULL
  4969. #define xlgw1 NULL
  4970. #endif /* GREEK */
  4971. /* Translation functions for Japanese Kanji character sets */
  4972. #ifdef KANJI
  4973. /*
  4974. Translate Kanji Transfer Character Set (EUC) to local file character set,
  4975. contributed by Dr. Hirofumi Fujii, Japan High Energy Research Laboratory
  4976. (KEK), Tokyo, Japan.
  4977. a is a byte to be translated, which may be a single-byte character,
  4978. the Katakana prefix, the first byte of a two-byte Kanji character, or the
  4979. second byte of 2-byte Kanji character.
  4980. fn is the output function.
  4981. Returns 0 on success, -1 on failure.
  4982. */
  4983. _PROTOTYP(static int jpnxas, (int, int[]) );
  4984. _PROTOTYP(static int jpnxkt, (int, int[]) );
  4985. _PROTOTYP(static int jpnxkn, (int[], int[]) );
  4986. static int jpncnt; /* Byte count for Japanese */
  4987. static int jpnlst; /* Last status (for JIS7) */
  4988. static int
  4989. jpnxas(a, obuf) int a; int obuf[]; { /* Translate ASCII to local file code */
  4990. int r;
  4991. r = 0;
  4992. if (fcharset == FC_JIS7) {
  4993. switch (jpnlst) {
  4994. case 1:
  4995. obuf[0] = 0x0f;
  4996. obuf[1] = a;
  4997. r = 2;
  4998. break;
  4999. case 2:
  5000. obuf[0] = 0x1b;
  5001. obuf[1] = 0x28;
  5002. obuf[2] = 0x4a;
  5003. obuf[3] = a;
  5004. r = 4;
  5005. break;
  5006. default:
  5007. obuf[0] = a;
  5008. r = 1;
  5009. break;
  5010. }
  5011. } else {
  5012. obuf[0] = a;
  5013. r = 1;
  5014. }
  5015. return(r);
  5016. }
  5017. static int
  5018. jpnxkt(a, obuf) int a; int obuf[]; {
  5019. /* Translate JIS X 201 Katakana to local code */
  5020. int r;
  5021. r = 0;
  5022. if (fcharset == FC_JIS7) {
  5023. switch (jpnlst) {
  5024. case 2: /* from Kanji */
  5025. obuf[r++] = 0x1b;
  5026. obuf[r++] = 0x28;
  5027. obuf[r++] = 0x4a;
  5028. case 0: /* from Roman */
  5029. obuf[r++] = 0x0e;
  5030. default:
  5031. obuf[r++] = (a & 0x7f);
  5032. break;
  5033. }
  5034. } else {
  5035. if (fcharset == FC_JEUC)
  5036. obuf[r++] = 0x8e;
  5037. obuf[r++] = (a | 0x80);
  5038. }
  5039. return(r);
  5040. }
  5041. static int
  5042. jpnxkn(ibuf, obuf) int ibuf[], obuf[]; {
  5043. /* Translate JIS X 0208 Kanji to local code */
  5044. int c1, c2;
  5045. int r;
  5046. c1 = ibuf[0] & 0x7f;
  5047. c2 = ibuf[1] & 0x7f;
  5048. if (fcharset == FC_SHJIS) {
  5049. if (c1 & 1)
  5050. c2 += 0x1f;
  5051. else
  5052. c2 += 0x7d;
  5053. if (c2 >= 0x7f) c2++;
  5054. c1 = ((c1 - 0x21) >> 1) + 0x81;
  5055. if (c1 > 0x9f) c1 += 0x40;
  5056. obuf[0] = c1;
  5057. obuf[1] = c2;
  5058. r = 2;
  5059. } else if (fcharset == FC_JIS7) {
  5060. r = 0;
  5061. switch (jpnlst) {
  5062. case 1:
  5063. obuf[r++] = 0x0f; /* From Katakana */
  5064. case 0:
  5065. obuf[r++] = 0x1b;
  5066. obuf[r++] = 0x24;
  5067. obuf[r++] = 0x42;
  5068. default:
  5069. obuf[r++] = c1;
  5070. obuf[r++] = c2;
  5071. break;
  5072. }
  5073. } else {
  5074. obuf[0] = (c1 | 0x80);
  5075. obuf[1] = (c2 | 0x80);
  5076. r = 2;
  5077. }
  5078. return(r);
  5079. }
  5080. int
  5081. xkanjf() {
  5082. /* Initialize parameters for xkanji */
  5083. /* This function should be called when F/X-packet is received */
  5084. jpncnt = jpnlst = 0;
  5085. return(0);
  5086. }
  5087. int
  5088. #ifdef CK_ANSIC
  5089. xkanjz(int (*fn)(char))
  5090. #else
  5091. xkanjz(fn) int (*fn)();
  5092. #endif /* CK_ANSIC */
  5093. { /* xkanjz */
  5094. /*
  5095. Terminate xkanji
  5096. This function must be called when Z-packet is received
  5097. (before closing the file).
  5098. */
  5099. static int obuf[6];
  5100. int r, i, c;
  5101. if (fcharset == FC_JIS7) {
  5102. c = 'A'; /* Dummy Roman character */
  5103. r = jpnxas(c, obuf) - 1; /* -1 removes Dummy character */
  5104. if (r > 0) {
  5105. for (i = 0; i < r; i++)
  5106. if (((*fn)((char) obuf[i])) < 0)
  5107. return(-1);
  5108. }
  5109. }
  5110. return(0);
  5111. }
  5112. int
  5113. #ifdef CK_ANSIC
  5114. xkanji(int a, int (*fn)(char))
  5115. #else
  5116. xkanji(a, fn) int a; int (*fn)();
  5117. #endif /* CK_ANSIC */
  5118. { /* xkanji */
  5119. static int xbuf[2];
  5120. static int obuf[8];
  5121. int i, r;
  5122. int c7;
  5123. int state=0;
  5124. r = 0;
  5125. if (jpncnt == 0) {
  5126. /* 1st byte */
  5127. if ((a & 0x80) == 0) {
  5128. /* 8th bit is 0, i.e., single-byte code */
  5129. r = jpnxas(a, obuf);
  5130. state = 0;
  5131. } else {
  5132. /* 8th bit is 1, check the range */
  5133. c7 = a & 0x7f;
  5134. if (((c7 > 0x20) && (c7 < 0x7f)) || (c7 == 0x0e)) {
  5135. /* double byte code */
  5136. xbuf[jpncnt++] = a;
  5137. } else {
  5138. /* single byte code */
  5139. r = jpnxas(a, obuf);
  5140. state = 0;
  5141. }
  5142. }
  5143. } else {
  5144. /* not the 1st byte */
  5145. xbuf[jpncnt++] = a;
  5146. if (xbuf[0] == 0x8e) {
  5147. r = jpnxkt(xbuf[1], obuf);
  5148. state = 1;
  5149. } else {
  5150. r = jpnxkn(xbuf, obuf);
  5151. state = 2;
  5152. }
  5153. }
  5154. if (r > 0) {
  5155. for (i = 0; i < r; i++ )
  5156. if (((*fn)((char) obuf[i])) < 0)
  5157. return(-1);
  5158. jpnlst = state;
  5159. jpncnt = 0;
  5160. }
  5161. return(0);
  5162. }
  5163. /*
  5164. Function for translating from Japanese file character set
  5165. to Japanese EUC transfer character set.
  5166. Returns a pointer to a string containing 0, 1, or 2 bytes.
  5167. */
  5168. /* zkanji */
  5169. static int jpnstz; /* status for JIS-7 */
  5170. static int jpnpnd; /* number of pending bytes */
  5171. static int jpnpnt; /* pending buffer index */
  5172. static int jpnpbf[8]; /* pending buffer */
  5173. /* There is some duplication here between the old and new JIS-7 parsers */
  5174. /* to be cleaned up later... */
  5175. VOID
  5176. j7init() { /* Initialize JIS-7 parser */
  5177. jpnstz = 0;
  5178. jpnpnd = 0;
  5179. jpnpnt = 0;
  5180. }
  5181. int
  5182. getj7() { /* Reads JIS-7 returns next EUC byte */
  5183. int x;
  5184. if (jpnpnd > 0) { /* If something is pending */
  5185. x = (unsigned) jpnpbf[jpnpnt++]; /* Get it */
  5186. jpnpnd--;
  5187. if (jpnpnd < 0) jpnpnd = 0;
  5188. return((unsigned)x);
  5189. }
  5190. jpnpnt = 0;
  5191. if ((x = zminchar()) < 0) return(x);
  5192. while (jpnpnd == 0) { /* While something is pending... */
  5193. if ((x > 0x20) && (x < 0x7f)) { /* 7-bit graphic character */
  5194. switch (jpnstz) {
  5195. case 1: /* Katakana */
  5196. #ifdef COMMENT
  5197. /* This can't be right... */
  5198. jpnpbf[jpnpnd++] = 0x80; /* Insert flag (NOT SS2???) */
  5199. #else
  5200. jpnpbf[jpnpnd++] = 0x8e; /* Insert SS2 */
  5201. #endif /* COMMENT */
  5202. jpnpbf[jpnpnd++] = (x | 0x80); /* Insert Kana + 8th bit */
  5203. break;
  5204. case 2: /* Kanji */
  5205. jpnpbf[jpnpnd++] = (x | 0x80); /* Get another byte */
  5206. if ((x = zminchar()) < 0) return(x);
  5207. jpnpbf[jpnpnd++] = (x | 0x80);
  5208. break;
  5209. default: /* ASCII / JIS Roman */
  5210. jpnpbf[jpnpnd++] = x;
  5211. break;
  5212. }
  5213. } else if (x == 0x0e) { /* ^N = SO */
  5214. jpnstz = 1; /* Katakana */
  5215. if ((x = zminchar()) < 0) return(x);
  5216. } else if (x == 0x0f) { /* ^O = SI */
  5217. jpnstz = 0; /* ASCII / JIS Roman */
  5218. if ((x = zminchar()) < 0) return(x);
  5219. } else if (x == 0x1b) { /* Escape */
  5220. jpnpbf[jpnpnd++] = x; /* Save in buffer */
  5221. if ((x = zminchar()) < 0) return(x);
  5222. jpnpbf[jpnpnd++] = x; /* Save in buffer */
  5223. if (x == '$') { /* <ESC>$ */
  5224. if ((x = zminchar()) < 0) return(x);
  5225. jpnpbf[jpnpnd++] = x;
  5226. if ((x == '@') || (x == 'B')) { /* Kanji */
  5227. jpnstz = 2;
  5228. jpnpnt = jpnpnd = 0;
  5229. if ((x = zminchar()) < 0) return(x);
  5230. }
  5231. } else if (x == '(') { /* <ESC>( == 94-byte single-byte set */
  5232. if ((x = zminchar()) < 0) return(x);
  5233. jpnpbf[jpnpnd++] = x;
  5234. if ((x == 'B') || (x == 'J')) { /* ASCII or JIS Roman */
  5235. jpnstz = 0; /* Set state */
  5236. jpnpnt = jpnpnd = 0; /* Reset pointers */
  5237. if ((x = zminchar()) < 0) return(x);
  5238. }
  5239. } else if (x == 0x1b) { /* <ESC><ESC> */
  5240. jpnpnt = jpnpnd = 0; /* Reset pointers, stay in state */
  5241. if ((x = zminchar()) < 0) return(x);
  5242. }
  5243. } else { /* Not <ESC> - just save it */
  5244. jpnpbf[jpnpnd++] = x;
  5245. }
  5246. }
  5247. jpnpnt = 0;
  5248. x = (unsigned)jpnpbf[jpnpnt++];
  5249. jpnpnd--;
  5250. return((unsigned)x);
  5251. }
  5252. USHORT
  5253. #ifdef CK_ANSIC
  5254. eu_to_sj(USHORT eu) /* EUC-JP to Shift-JIS */
  5255. #else
  5256. eu_to_sj(eu) USHORT eu;
  5257. #endif /* CK_ANSIC */
  5258. {
  5259. int c1, c2;
  5260. union ck_short jcode,scode;
  5261. jcode.x_short = eu;
  5262. c1 = (jcode.x_char[byteorder] & 0x7f);
  5263. c2 = (jcode.x_char[1-byteorder] & 0x7f);
  5264. if (c1 & 1)
  5265. c2 += 0x1f;
  5266. else
  5267. c2 += 0x7d;
  5268. if (c2 >= 0x7f)
  5269. c2++;
  5270. c1 = ((c1 - 0x21) >> 1) + 0x81;
  5271. if (c1 > 0x9f)
  5272. c1 += 0x40;
  5273. scode.x_char[byteorder] = c1;
  5274. scode.x_char[1-byteorder] = c2;
  5275. return(scode.x_short);
  5276. }
  5277. USHORT
  5278. #ifdef CK_ANSIC
  5279. sj_to_eu(USHORT sj) /* Shift-JIS to EUC-JP */
  5280. #else
  5281. sj_to_eu(sj) USHORT sj;
  5282. #endif /* CK_ANSIC */
  5283. {
  5284. union ck_short jcode, scode;
  5285. int c0, c1;
  5286. scode.x_short = sj;
  5287. c0 = scode.x_char[byteorder]; /* Left (hi order) byte */
  5288. c1 = scode.x_char[1-byteorder]; /* Right (lo order) byte */
  5289. if (((c0 >= 0x81) && (c0 <= 0x9f)) || /* High order byte has 8th bit set */
  5290. ((c0 >= 0xe0) && (c0 <= 0xfc))) { /* Kanji */
  5291. if (c0 <= 0x9f) /* Two bytes in */
  5292. c0 -= 0x71; /* Do the shifting... */
  5293. else
  5294. c0 -= 0xb1;
  5295. c0 = c0 * 2 + 1;
  5296. if (c1 > 0x7f) c1 -= 1;
  5297. if (c1 >= 0x9e) {
  5298. c1 -= 0x7d;
  5299. c0 += 1;
  5300. } else {
  5301. c1 -= 0x1f;
  5302. }
  5303. jcode.x_char[byteorder] = (c0 | 0x80); /* Two bytes out */
  5304. jcode.x_char[1-byteorder] = (c1 | 0x80);
  5305. } else if (c0 == 0) { /* Single byte */
  5306. if (c1 >= 0xa1 && c1 <= 0xdf) { /* Katakana */
  5307. jcode.x_char[byteorder] = 0x8e; /* SS2 */
  5308. jcode.x_char[1-byteorder] = c1; /* Kana code */
  5309. } else { /* ASCII or C0 */
  5310. jcode.x_short = c1;
  5311. }
  5312. } else { /* Something bad */
  5313. debug(F001,"sj_to_eu bad sj","",sj);
  5314. jcode.x_short = 0xffff;
  5315. }
  5316. return(jcode.x_short);
  5317. }
  5318. int
  5319. zkanjf() { /* Initialize */
  5320. jpnstz = jpnpnd = jpnpnt = 0;
  5321. return(0);
  5322. }
  5323. int
  5324. zkanjz() {
  5325. return(0);
  5326. }
  5327. int
  5328. #ifdef CK_ANSIC
  5329. zkanji(int (*fn)(void))
  5330. #else
  5331. zkanji(fn) int (*fn)();
  5332. #endif /* CK_ANSIC */
  5333. { /* zkanji */
  5334. /* Read Japanese local code and translate to Japanese EUC */
  5335. int a;
  5336. int sc[3];
  5337. /* No pending characters */
  5338. if (fcharset == FC_SHJIS) { /* Translating from Shift-JIS */
  5339. if (jpnpnd) {
  5340. jpnpnd--;
  5341. return(jpnpbf[jpnpnt++]);
  5342. }
  5343. a = (*fn)();
  5344. jpnpnd = jpnpnt = 0;
  5345. if (((a >= 0x81) && (a <= 0x9f)) ||
  5346. ((a >= 0xe0) && (a <= 0xfc))) { /* 2-byte Kanji code */
  5347. sc[0] = a;
  5348. if ((sc[1] = (*fn)()) < 0) /* Get second byte */
  5349. return(sc[1]);
  5350. if (sc[0] <= 0x9f)
  5351. sc[0] -= 0x71;
  5352. else
  5353. sc[0] -= 0xb1;
  5354. sc[0] = sc[0] * 2 + 1;
  5355. if (sc[1] > 0x7f)
  5356. sc[1]--;
  5357. if (sc[1] >= 0x9e) {
  5358. sc[1] -= 0x7d;
  5359. sc[0]++;
  5360. } else {
  5361. sc[1] -= 0x1f;
  5362. }
  5363. a = (sc[0] | 0x80);
  5364. jpnpbf[0] = (sc[1] | 0x80);
  5365. jpnpnd = 1;
  5366. jpnpnt = 0;
  5367. } else if ((a >= 0xa1) && (a <= 0xdf)) { /* Katakana */
  5368. jpnpbf[0] = a;
  5369. jpnpnd = 1;
  5370. jpnpnt = 0;
  5371. a = 0x8e;
  5372. }
  5373. return(a);
  5374. } else if (fcharset == FC_JIS7 ) { /* 7-bit JIS X 0208 */
  5375. if (jpnpnd) {
  5376. a = jpnpbf[jpnpnt++];
  5377. jpnpnd--;
  5378. return(a);
  5379. }
  5380. jpnpnt = 0;
  5381. if ((a = (*fn)()) < 0)
  5382. return(a);
  5383. while (jpnpnd == 0) {
  5384. if ((a > 0x20) && (a < 0x7f)) {
  5385. switch (jpnstz) {
  5386. case 1:
  5387. jpnpbf[jpnpnd++] = 0x80; /* Katakana */
  5388. jpnpbf[jpnpnd++] = (a | 0x80);
  5389. break;
  5390. case 2:
  5391. jpnpbf[jpnpnd++] = (a | 0x80); /* Kanji */
  5392. if ((a = (*fn)()) < 0)
  5393. return(a);
  5394. jpnpbf[jpnpnd++] = (a | 0x80);
  5395. break;
  5396. default:
  5397. jpnpbf[jpnpnd++] = a; /* Single byte */
  5398. break;
  5399. }
  5400. } else if (a == 0x0e) {
  5401. jpnstz = 1;
  5402. if ((a = (*fn)()) < 0)
  5403. return(a);
  5404. } else if (a == 0x0f) {
  5405. jpnstz = 0;
  5406. if ((a = (*fn)()) < 0)
  5407. return(a);
  5408. } else if (a == 0x1b) {
  5409. jpnpbf[jpnpnd++] = a; /* Escape */
  5410. if ((a = (*fn)()) < 0)
  5411. return(a);
  5412. jpnpbf[jpnpnd++] = a;
  5413. if (a == '$') {
  5414. if ((a = (*fn)()) < 0)
  5415. return(a);
  5416. jpnpbf[jpnpnd++] = a;
  5417. if ((a == '@') || (a == 'B')) {
  5418. jpnstz = 2;
  5419. jpnpnt = jpnpnd = 0;
  5420. if ((a = (*fn)()) < 0)
  5421. return(a);
  5422. }
  5423. } else if (a == '(') {
  5424. if ((a = (*fn)()) < 0)
  5425. return(a);
  5426. jpnpbf[jpnpnd++] = a;
  5427. if ((a == 'B') || (a == 'J')) {
  5428. jpnstz = 0;
  5429. jpnpnt = jpnpnd = 0;
  5430. if ((a = (*fn)()) < 0)
  5431. return(a);
  5432. }
  5433. } else if (a == 0x1b) {
  5434. jpnpnt = jpnpnd = 0;
  5435. if ((a = (*fn)()) < 0)
  5436. return(a);
  5437. }
  5438. } else {
  5439. jpnpbf[jpnpnd++] = a;
  5440. }
  5441. }
  5442. jpnpnt = 0;
  5443. a = jpnpbf[jpnpnt++];
  5444. jpnpnd--;
  5445. return(a);
  5446. } else {
  5447. a = (*fn)();
  5448. return(a);
  5449. }
  5450. }
  5451. #endif /* KANJI */
  5452. /* Euro functions */
  5453. #ifdef LATIN2
  5454. CHAR
  5455. #ifdef CK_ANSIC
  5456. xl2l9(CHAR c)
  5457. #else
  5458. xl2l9(c) CHAR c;
  5459. #endif /* CK_ANSIC */
  5460. { /* xl2l9 */ /* Latin-2 to Latin-9... */
  5461. switch (c) {
  5462. case 169: return((CHAR)166); /* S caron */
  5463. case 185: return((CHAR)168); /* s caron */
  5464. case 174: return((CHAR)180); /* Z caron */
  5465. case 190: return((CHAR)184); /* z caron */
  5466. default:
  5467. return(yl2l1[c]);
  5468. }
  5469. }
  5470. _PROTOTYP( CHAR xl258, ( CHAR ) );
  5471. CHAR
  5472. #ifdef CK_ANSIC
  5473. xl258(CHAR c)
  5474. #else
  5475. xl258(c) CHAR c;
  5476. #endif /* CK_ANSIC */
  5477. { /* xl258 */ /* Latin-2 to CP858... */
  5478. return(c);
  5479. }
  5480. #else
  5481. #define xl2l9 NULL
  5482. #define xl258 NULL
  5483. #endif /* LATIN2 */
  5484. CHAR
  5485. #ifdef CK_ANSIC
  5486. zl9as(CHAR c)
  5487. #else
  5488. zl9as(c) CHAR c;
  5489. #endif /* CK_ANSIC */
  5490. { /* zl9as */ /* Latin-9 to US ASCII... */
  5491. if (c < (CHAR)0x80) return(c); /* Save a function call */
  5492. switch (c) {
  5493. case 0xa4: return(UNK); /* Euro */
  5494. case 0xa6: return('S'); /* S Caron */
  5495. case 0xa8: return('s'); /* s Caron */
  5496. case 0xb4: return('Z'); /* Z Caron */
  5497. case 0xbc: return('O'); /* OE digraph */
  5498. case 0xbd: return('o'); /* oe digraph */
  5499. case 0xbe: return('Y'); /* Y diaeresis */
  5500. default: return(zl1as(c)); /* The rest is like Latin-1 */
  5501. }
  5502. }
  5503. _PROTOTYP( CHAR xl9as, ( CHAR ) );
  5504. CHAR
  5505. #ifdef CK_ANSIC
  5506. xl9as(CHAR c)
  5507. #else
  5508. xl9as(c) CHAR c;
  5509. #endif /* CK_ANSIC */
  5510. { /* xl9as */ /* Latin-9 to US ASCII... */
  5511. if (c < (CHAR)0x80) return(c); /* Save a function call */
  5512. switch (c) {
  5513. case 0xa4: return(UNK); /* Euro */
  5514. case 0xa6: return('S'); /* S Caron */
  5515. case 0xa8: return('s'); /* s Caron */
  5516. case 0xb4: return('Z'); /* Z Caron */
  5517. case 0xb8: return('z'); /* z Caron */
  5518. case 0xbc: return('O'); /* OE digraph */
  5519. case 0xbd: return('o'); /* oe digraph */
  5520. case 0xbe: return('Y'); /* Y diaeresis */
  5521. default: return(xl1as(c)); /* The rest is like Latin-1 */
  5522. }
  5523. }
  5524. CHAR /* CP1252 to Latin-9 */
  5525. #ifdef CK_ANSIC
  5526. xw1l9(CHAR c)
  5527. #else
  5528. xw1l9(c) CHAR c;
  5529. #endif /* CK_ANSIC */
  5530. { /* xw1l9 */
  5531. switch (c) {
  5532. case 0x80: return(0xa4); /* Euro sign */
  5533. case 0x8a: return(0xa6); /* S caron */
  5534. case 0x8c: return(0xbc); /* OE */
  5535. case 0x8e: return(0xb4); /* Z caron */
  5536. case 0x9a: return(0xa8); /* s caron */
  5537. case 0x9c: return(0xbd); /* oe */
  5538. case 0x9e: return(0xb8); /* z caron */
  5539. case 0x9f: return(0xbe); /* Y diaeresis */
  5540. case 0xa4: /* Currency sign */
  5541. case 0xa6: /* Broken vertical bar */
  5542. case 0xa8: /* Diaeresis */
  5543. case 0xb4: /* Acute accent */
  5544. case 0xb8: /* Cedilla */
  5545. case 0xbc: /* 1/4 */
  5546. case 0xbd: /* 1/2 */
  5547. case 0xbe: return('?'); /* 3/4 */
  5548. default: return((c < 160) ? xw1as(c) : c);
  5549. }
  5550. }
  5551. #ifdef LATIN2
  5552. CHAR
  5553. #ifdef CK_ANSIC
  5554. xl9l2(CHAR c)
  5555. #else
  5556. xl9l2(c) CHAR c;
  5557. #endif /* CK_ANSIC */
  5558. { /* xl9l2 */ /* Latin-9 to Latin-2... */
  5559. if (c < (CHAR)0x80) return(c); /* Save a function call */
  5560. switch (c) {
  5561. case 0xa4: return(UNK); /* Euro */
  5562. case 0xa6: return((CHAR)0xa9); /* S Caron */
  5563. case 0xa8: return((CHAR)0xb9); /* s Caron */
  5564. case 0xb4: return((CHAR)0xae); /* Z Caron */
  5565. case 0xb8: return((CHAR)0xaf); /* z Caron */
  5566. case 0xbc: return('O'); /* OE digraph */
  5567. case 0xbd: return('o'); /* oe digraph */
  5568. case 0xbe: return('Y'); /* Y diaeresis */
  5569. default: return(xl1l2(c)); /* The rest is like Latin-1 */
  5570. }
  5571. }
  5572. #else
  5573. #define xl9l2 NULL
  5574. #endif /* LATIN2 */
  5575. CHAR
  5576. #ifdef CK_ANSIC
  5577. xl958(CHAR c)
  5578. #else
  5579. xl958(c) CHAR c;
  5580. #endif /* CK_ANSIC */
  5581. { /* xl958 */ /* Latin-9 to CP858... */
  5582. if (c == 0xa4) /* Euro Symbol */
  5583. return((CHAR)0xd5);
  5584. else if (c == 0x9e) /* This was currency symbol */
  5585. return((CHAR)0xcf);
  5586. c = yl185[c];
  5587. return(c);
  5588. }
  5589. CHAR
  5590. #ifdef CK_ANSIC
  5591. x58as(CHAR c)
  5592. #else
  5593. x58as(c) CHAR c;
  5594. #endif /* CK_ANSIC */
  5595. { /* x58as */ /* CP858 to US ASCII... */
  5596. if (c == 0xd5) /* Euro rather than dotless i */
  5597. return(UNK);
  5598. else
  5599. return(x85as(c)); /* The rest is like CP850 */
  5600. }
  5601. CHAR
  5602. #ifdef CK_ANSIC
  5603. x58l1(CHAR c)
  5604. #else
  5605. x58l1(c) CHAR c;
  5606. #endif /* CK_ANSIC */
  5607. { /* x58l1 */ /* CP858 to Latin-1... */
  5608. if (c == 0xd5) /* Euro rather than dotless i */
  5609. return((CHAR)0xa4); /* Return currency symbol */
  5610. else if (c == 0xcf) /* This keeps it invertible */
  5611. return((CHAR)0x9e);
  5612. else
  5613. return(x85l1(c));
  5614. }
  5615. #ifdef LATIN2
  5616. CHAR
  5617. #ifdef CK_ANSIC
  5618. x58l2(CHAR c)
  5619. #else
  5620. x58l2(c) CHAR c;
  5621. #endif /* CK_ANSIC */
  5622. { /* x58l2 */ /* CP858 to Latin-2... */
  5623. if (c == 0xd5) /* Euro rather than dotless i */
  5624. return((CHAR)0xa4); /* Return currency symbol */
  5625. else if (c == 0xcf) /* This keeps it invertible */
  5626. return((CHAR)0x9e); /* (if it ever was...) */
  5627. else /* Otherwise like CP850 */
  5628. return(x85l2(c));
  5629. }
  5630. #else
  5631. #define x58l2 NULL
  5632. #endif /* LATIN2 */
  5633. CHAR
  5634. #ifdef CK_ANSIC
  5635. x58l9(CHAR c)
  5636. #else
  5637. x58l9(c) CHAR c;
  5638. #endif /* CK_ANSIC */
  5639. { /* x58l9 */ /* CP-858 to Latin-9... */
  5640. if (c == 0xd5) /* Euro rather than dotless i */
  5641. return((CHAR)0xa4); /* Return currency symbol */
  5642. else if (c == 0xcf) /* This keeps it invertible */
  5643. return((CHAR)0x9e); /* (if it ever was...) */
  5644. else /* Otherwise like CP850 */
  5645. return(x85l1(c)); /* to Latin-1 */
  5646. }
  5647. /* End Euro functions */
  5648. /* TABLES OF TRANSLATION FUNCTIONS */
  5649. /*
  5650. First, the table of translation functions for RECEIVING files. That is,
  5651. *from* the TRANSFER character set *to* the FILE character set, an array of
  5652. pointers to functions. The first index is the TRANSFER CHARACTER-SET
  5653. number, the second index is the FILE CHARACTER-SET number.
  5654. These arrays must be fully populated, even if (as is the case with Kanji
  5655. character sets), all the entries are NULL. Otherwise, subscript
  5656. calculations will be wrong and we'll use the wrong functions.
  5657. */
  5658. /* Pointers to byte-for-byte translation functions */
  5659. _PROTOTYP( CHAR (*rx), (CHAR) );
  5660. _PROTOTYP( CHAR (*sx), (CHAR) );
  5661. #ifdef UNICODE
  5662. _PROTOTYP( int (*xut), (USHORT) ); /* Translation function UCS to TCS */
  5663. _PROTOTYP( int (*xuf), (USHORT) ); /* Translation function UCS to FCS */
  5664. _PROTOTYP( USHORT (*xtu), (CHAR) ); /* Translation function TCS to UCS */
  5665. _PROTOTYP( USHORT (*xfu), (CHAR) ); /* Translation function FCS to UCS */
  5666. #endif /* UNICODE */
  5667. #ifdef CK_ANSIC
  5668. CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])(CHAR) =
  5669. #else
  5670. CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])() =
  5671. #endif /* CK_ANSIC */
  5672. {
  5673. NULL, /* 0,0 transparent to us ascii */
  5674. NULL, /* 0,1 transparent to uk ascii */
  5675. NULL, /* 0,2 transparent to dutch nrc */
  5676. NULL, /* 0,3 transparent to finnish nrc */
  5677. NULL, /* 0,4 transparent to french nrc */
  5678. NULL, /* 0,5 transparent to fr-canadian nrc */
  5679. NULL, /* 0,6 transparent to german nrc */
  5680. NULL, /* 0,7 transparent to hungarian nrc */
  5681. NULL, /* 0,8 transparent to italian nrc */
  5682. NULL, /* 0,9 transparent to norge/danish nrc */
  5683. NULL, /* 0,10 transparent to portuguese nrc */
  5684. NULL, /* 0,11 transparent to spanish nrc */
  5685. NULL, /* 0,12 transparent to swedish nrc */
  5686. NULL, /* 0,13 transparent to swiss nrc */
  5687. NULL, /* 0,14 transparent to latin-1 */
  5688. NULL, /* 0,15 transparent to latin-2 */
  5689. NULL, /* 0,16 transparent to DEC MCS */
  5690. NULL, /* 0,17 transparent to NeXT */
  5691. NULL, /* 0,18 transparent to CP437 */
  5692. NULL, /* 0,19 transparent to CP850 */
  5693. NULL, /* 0,20 transparent to CP852 */
  5694. NULL, /* 0,21 transparent to Macintosh Latin */
  5695. NULL, /* 0,22 transparent to DGI */
  5696. NULL, /* 0,23 transparent to HP */
  5697. NULL, /* 0,24 transparent to Latin/Cyrillic */
  5698. NULL, /* 0,25 transparent to CP866 */
  5699. NULL, /* 0,26 transparent to Short KOI-7 */
  5700. NULL, /* 0,27 transparent to Old KOI-8 Cyrillic */
  5701. NULL, /* 0,28 transparent to JIS-7 */
  5702. NULL, /* 0,29 transparent to Shift-JIS */
  5703. NULL, /* 0,30 transparent to J-EUC */
  5704. NULL, /* 0,31 transparent to DEC Kanji */
  5705. NULL, /* 0,32 transparent to Hebrew-7 */
  5706. NULL, /* 0,33 transparent to Latin/Hebrew */
  5707. NULL, /* 0,34 transparent to CP862 Hebrew */
  5708. NULL, /* 0,35 transparent to ELOT 927 Greek */
  5709. NULL, /* 0,36 transparent to Latin/Greek */
  5710. NULL, /* 0,37 transparent to CP869 */
  5711. NULL, /* 0,38 transparent to Latin-9 */
  5712. NULL, /* 0,39 transparent to CP858 */
  5713. NULL, /* 0,40 transparent to CP855 */
  5714. NULL, /* 0,41 transparent to CP1251 */
  5715. NULL, /* 0,42 transparent to Bulgarian */
  5716. NULL, /* 0,43 transparent to CP1250 */
  5717. NULL, /* 0,44 transparent to Mazovia */
  5718. NULL, /* 0,45 transparent to UCS-2 */
  5719. NULL, /* 0,46 transparent to UTF-8 */
  5720. NULL, /* 0,47 transparent to KOI8R */
  5721. NULL, /* 0,48 transparent to KOI8U */
  5722. NULL, /* 0,49 transparent to CP1252 */
  5723. NULL, /* 1,0 ascii to us ascii */
  5724. NULL, /* 1,1 ascii to uk ascii */
  5725. NULL, /* 1,2 ascii to dutch nrc */
  5726. NULL, /* 1,3 ascii to finnish nrc */
  5727. NULL, /* 1,4 ascii to french nrc */
  5728. NULL, /* 1,5 ascii to fr-canadian nrc */
  5729. NULL, /* 1,6 ascii to german nrc */
  5730. NULL, /* 1,7 ascii to hungarian nrc */
  5731. NULL, /* 1,8 ascii to italian nrc */
  5732. NULL, /* 1,9 ascii to norge/danish nrc */
  5733. NULL, /* 1,10 ascii to portuguese nrc */
  5734. NULL, /* 1,11 ascii to spanish nrc */
  5735. NULL, /* 1,12 ascii to swedish nrc */
  5736. NULL, /* 1,13 ascii to swiss nrc */
  5737. NULL, /* 1,14 ascii to latin-1 */
  5738. NULL, /* 1,15 ascii to latin-2 */
  5739. NULL, /* 1,16 ascii to DEC MCS */
  5740. NULL, /* 1,17 ascii to NeXT */
  5741. NULL, /* 1,18 ascii to CP437 */
  5742. NULL, /* 1,19 ascii to CP850 */
  5743. NULL, /* 1,20 ascii to CP852 */
  5744. NULL, /* 1,21 ascii to Macintosh Latin */
  5745. NULL, /* 1,22 ascii to DGI */
  5746. NULL, /* 1,23 ascii to HP */
  5747. xaslc, /* 1,24 ascii to Latin/Cyrillic */
  5748. xasac, /* 1,25 ascii to CP866 */
  5749. xassk, /* 1,26 ascii to Short KOI */
  5750. xask8, /* 1,27 ascii to Old KOI-8 Cyrillic */
  5751. NULL, /* 1,28 ascii to JIS-7 */
  5752. NULL, /* 1,29 ascii to Shift-JIS */
  5753. NULL, /* 1,30 ascii to J-EUC */
  5754. NULL, /* 1,31 ascii to DEC Kanji */
  5755. xash7, /* 1,32 ascii to Hebrew-7 */
  5756. NULL, /* 1,33 ascii to Latin/Hebrew */
  5757. NULL, /* 1,34 ascii to CP862 Hebrew */
  5758. xaseg, /* 1,35 ascii to ELOT 927 Greek */
  5759. NULL, /* 1,36 ascii to Latin/Greek */
  5760. NULL, /* 1,37 ascii to CP869 */
  5761. NULL, /* 1,38 ascii to Latin-9 */
  5762. NULL, /* 1,39 ascii to CP858 */
  5763. xas55, /* 1,40 ascii to CP855 */
  5764. xas1251, /* 1,41 ascii to CP1251 */
  5765. xleft128, /* 1,42 ascii to bulgarian */
  5766. xleft128, /* 1,43 ascii to CP1250 */
  5767. xleft128, /* 1,44 ascii to Mazovia */
  5768. NULL, /* 1,45 ascii to UCS-2 */
  5769. NULL, /* 1,46 ascii to UTF-8 */
  5770. NULL, /* 1,47 ascii to KOI8-R */
  5771. NULL, /* 1,48 ascii to KOI8-U */
  5772. NULL, /* 1,49 ascii to CP1252 */
  5773. zl1as, /* 2,0 latin-1 to us ascii */
  5774. xl1uk, /* 2,1 latin-1 to uk ascii */
  5775. xl1du, /* 2,2 latin-1 to dutch nrc */
  5776. xl1fi, /* 2,3 latin-1 to finnish nrc */
  5777. xl1fr, /* 2,4 latin-1 to french nrc */
  5778. xl1fc, /* 2,5 latin-1 to fr-canadian nrc */
  5779. xl1ge, /* 2,6 latin-1 to german nrc */
  5780. xl1it, /* 2,7 latin-1 to italian nrc */
  5781. xl1hu, /* 2,8 latin-1 to hungarian nrc */
  5782. xl1no, /* 2,9 latin-1 to norge/danish nrc */
  5783. xl1po, /* 2,10 latin-1 to portuguese nrc */
  5784. xl1sp, /* 2,11 latin-1 to spanish nrc */
  5785. xl1sw, /* 2,12 latin-1 to swedish nrc */
  5786. xl1ch, /* 2,13 latin-1 to swiss nrc */
  5787. NULL, /* 2,14 latin-1 to latin-1 */
  5788. xl1l2, /* 2,15 latin-1 to latin-2 */
  5789. xl1dm, /* 2,16 latin-1 to DEC MCS */
  5790. xl1ne, /* 2,17 latin-1 to NeXT */
  5791. xl143, /* 2,18 latin-1 to CP437 */
  5792. xl185, /* 2,19 latin-1 to CP850 */
  5793. xl152, /* 2,20 latin-1 to CP852 */
  5794. xl1aq, /* 2,21 latin-1 to Macintosh Latin */
  5795. xl1dg, /* 2,22 latin-1 to DGI */
  5796. xl1r8, /* 2,23 latin-1 to HP Roman8 */
  5797. zl1as, /* 2,24 latin-1 to Latin/Cyrillic */
  5798. zl1as, /* 2,25 latin-1 to CP866 */
  5799. xl1sk, /* 2,26 latin-1 to Short KOI */
  5800. zl1as, /* 2,27 latin-1 to Old KOI-8 Cyrillic */
  5801. NULL, /* 2,28 latin-1 to JIS-7 */
  5802. NULL, /* 2,29 latin-1 to Shift-JIS */
  5803. NULL, /* 2,30 latin-1 to J-EUC */
  5804. NULL, /* 2,31 latin-1 to DEC Kanji */
  5805. xl1h7, /* 2,32 latin-1 to Hebrew-7 */
  5806. xl1lh, /* 2,33 latin-1 to Latin/Hebrew */
  5807. xl162, /* 2,34 latin-1 to CP862 Hebrew */
  5808. xl1eg, /* 2,35 latin-1 to ELOT 927 Greek */
  5809. xl1lg, /* 2,36 latin-1 to Latin/Greek */
  5810. xl169, /* 2,37 latin-1 to CP869 */
  5811. NULL, /* 2,38 latin-1 to Latin9 */
  5812. xl185, /* 2,39 latin-1 to CP858 */
  5813. zl1as, /* 2,40 latin-1 to CP855 */
  5814. zl1as, /* 2,41 latin-1 to CP1251 */
  5815. zl1as, /* 2,42 latin-1 to Bulgarian */
  5816. xl11250, /* 2,43 latin-1 to CP1250 */
  5817. xl1mz, /* 2,44 latin-1 to Mazovia */
  5818. NULL, /* 2,45 latin-1 to UCS-2 */
  5819. NULL, /* 2,46 latin-1 to UTF-8 */
  5820. zl1as, /* 2,47 latin-1 to KOI8R */
  5821. zl1as, /* 2,48 latin-1 to KOI8U */
  5822. xl1w1, /* 2,49 latin-1 to CP1252 */
  5823. xl2as, /* 3,0 latin-2 to us ascii */
  5824. xl2as, /* 3,1 latin-2 to uk ascii */
  5825. xl2as, /* 3,2 latin-2 to dutch nrc */
  5826. xl2as, /* 3,3 latin-2 to finnish nrc */
  5827. xl2as, /* 3,4 latin-2 to french nrc */
  5828. xl2as, /* 3,5 latin-2 to fr-canadian nrc */
  5829. xl2as, /* 3,6 latin-2 to german nrc */
  5830. xl2as, /* 3,7 latin-2 to italian nrc */
  5831. xl2as, /* 3,8 latin-2 to hungarian nrc */
  5832. xl2as, /* 3,9 latin-2 to norge/danish nrc */
  5833. xl2as, /* 3,10 latin-2 to portuguese nrc */
  5834. xl2as, /* 3,11 latin-2 to spanish nrc */
  5835. xl2as, /* 3,12 latin-2 to swedish nrc */
  5836. xl2as, /* 3,13 latin-2 to swiss nrc */
  5837. xl2l1, /* 3,14 latin-2 to latin-1 */
  5838. NULL, /* 3,15 latin-2 to latin-2 */
  5839. xl2l1, /* 3,16 latin-2 to DEC MCS */
  5840. xl2ne, /* 3,17 latin-2 to NeXT */
  5841. xl243, /* 3,18 latin-2 to CP437 */
  5842. xl285, /* 3,19 latin-2 to CP850 */
  5843. xl252, /* 3,20 latin-2 to CP852 */
  5844. xl2aq, /* 3,21 latin-2 to Macintosh Latin */
  5845. xl2dg, /* 3,22 latin-2 to DGI */
  5846. xl2r8, /* 3,23 latin-2 to HP */
  5847. xl2as, /* 3,24 latin-2 to Latin/Cyrillic */
  5848. xl2as, /* 3,25 latin-2 to CP866 */
  5849. xl2sk, /* 3,26 latin-2 to Short KOI */
  5850. xl2as, /* 3,27 latin-2 to Old KOI-8 Cyrillic */
  5851. NULL, /* 3,28 latin-2 to JIS-7 */
  5852. NULL, /* 3,29 latin-2 to Shift-JIS */
  5853. NULL, /* 3,30 latin-2 to J-EUC */
  5854. NULL, /* 3,31 latin-2 to DEC Kanji */
  5855. xl2h7, /* 3,32 latin-2 to Hebrew-7 */
  5856. xl2as, /* 3,33 latin-2 to Latin/Hebrew */
  5857. xl2as, /* 3,34 latin-2 to CP862 Hebrew */
  5858. xassk, /* 3,35 latin-2 to ELOT 927 Greek */
  5859. xl2as, /* 3,36 latin-2 to Latin/Greek */
  5860. xl2as, /* 3,37 latin-2 to CP869 */
  5861. xl2l9, /* 3,38 latin-2 to Latin-9 */
  5862. xl258, /* 3,39 latin-2 to CP858 */
  5863. xl2as, /* 3,40 latin-2 to CP855 */
  5864. xl2as, /* 3,41 latin-2 to CP1251 */
  5865. xl2as, /* 3,42 latin-2 to Bulgarian */
  5866. xl21250, /* 3,43 latin-2 to CP1250 */
  5867. xl2mz, /* 3,44 latin-2 to Mazovia */
  5868. NULL, /* 3,45 latin-2 to UCS-2 */
  5869. NULL, /* 3,46 latin-2 to UTF-8 */
  5870. xl2as, /* 3,47 latin-2 to KOI8R */
  5871. xl2as, /* 3,48 latin-2 to KOI8U */
  5872. xl2w1, /* 3,49 latin-2 to CP1252 */
  5873. xlcas, /* 4,0 latin/cyrillic to us ascii */
  5874. xlcas, /* 4,1 latin/cyrillic to uk ascii */
  5875. xlcas, /* 4,2 latin/cyrillic to dutch nrc */
  5876. xlcas, /* 4,3 latin/cyrillic to finnish ascii */
  5877. xlcas, /* 4,4 latin/cyrillic to french nrc */
  5878. xlcas, /* 4,5 latin/cyrillic to fr-canadian nrc */
  5879. xlcas, /* 4,6 latin/cyrillic to german nrc */
  5880. xlcas, /* 4,7 latin/cyrillic to italian nrc */
  5881. xlcas, /* 4,8 latin/cyrillic to hungarian nrc */
  5882. xlcas, /* 4,9 latin/cyrillic to norge/danish nrc */
  5883. xlcas, /* 4,10 latin/cyrillic to portuguese nrc */
  5884. xlcas, /* 4,11 latin/cyrillic to spanish nrc */
  5885. xlcas, /* 4,12 latin/cyrillic to swedish nrc */
  5886. xlcas, /* 4,13 latin/cyrillic to swiss nrc */
  5887. xlcas, /* 4,14 latin/cyrillic to latin-1 */
  5888. xlcas, /* 4,15 latin/cyrillic to latin-2 */
  5889. xlcas, /* 4,16 latin/cyrillic to DEC MCS */
  5890. xlcas, /* 4,17 latin/cyrillic to NeXT */
  5891. xlcas, /* 4,18 latin/cyrillic to CP437 */
  5892. xlcas, /* 4,19 latin/cyrillic to CP850 */
  5893. xlcas, /* 4,20 latin/cyrillic to CP852 */
  5894. xlcas, /* 4,21 latin/cyrillic to Macintosh Latin */
  5895. xlcas, /* 4,22 latin/cyrillic to DGI */
  5896. xlcas, /* 4,23 latin/cyrillic to HP */
  5897. NULL, /* 4,24 latin/cyrillic to Latin/Cyrillic */
  5898. xlcac, /* 4,25 latin/cyrillic to CP866 */
  5899. xlcsk, /* 4,26 latin/cyrillic to Short KOI */
  5900. xlck8, /* 4,27 latin/cyrillic to Old KOI-8 Cyrillic */
  5901. NULL, /* 4,28 latin/cyril to JIS-7 */
  5902. NULL, /* 4,29 latin/cyril to Shift-JIS */
  5903. NULL, /* 4,30 latin/cyril to J-EUC */
  5904. NULL, /* 4,31 latin/cyril to DEC Kanji */
  5905. xlch7, /* 4,32 latin/cyril to Hebrew-7 */
  5906. xlcas, /* 4,33 latin/cyril to Latin/Hebrew */
  5907. xlcas, /* 4,34 latin/cyril to CP862 Hebrew */
  5908. xassk, /* 4,35 latin/cyril to ELOT 927 Greek */
  5909. xleft160, /* 4,36 latin/cyril to Latin/Greek */
  5910. xleft128, /* 4,37 latin/cyril to CP869 */
  5911. xlcas, /* 4,38 latin/cyril to latin-9 */
  5912. xlcas, /* 4,39 latin/cyril to CP858 */
  5913. xlc55, /* 4,40 latin/cyril to CP855 */
  5914. xlc1251, /* 4,41 latin/cyril to CP1251 */
  5915. xlcbu, /* 4,42 latin/cyril to Bulgarian */
  5916. xlcas, /* 4,43 latin/cyril to CP1250 */
  5917. xlcas, /* 4,44 latin/cyril to Mazovia */
  5918. NULL, /* 4,45 latin/cyril to UCS-2 */
  5919. NULL, /* 4,46 latin/cyril to UTF-8 */
  5920. xlckr, /* 4,47 latin/cyril to KOI8R */
  5921. xlcku, /* 4,48 latin/cyril to KOI8U */
  5922. xlcas, /* 4,49 latin/cyril to CP1252 */
  5923. NULL, /* 5,00 */
  5924. NULL, /* 5,01 */
  5925. NULL, /* 5,02 */
  5926. NULL, /* 5,03 */
  5927. NULL, /* 5,04 */
  5928. NULL, /* 5,05 */
  5929. NULL, /* 5,06 */
  5930. NULL, /* 5,07 */
  5931. NULL, /* 5,08 */
  5932. NULL, /* 5,09 */
  5933. NULL, /* 5,10 */
  5934. NULL, /* 5,11 */
  5935. NULL, /* 5,12 */
  5936. NULL, /* 5,13 */
  5937. NULL, /* 5,14 */
  5938. NULL, /* 5,15 */
  5939. NULL, /* 5,16 */
  5940. NULL, /* 5,17 */
  5941. NULL, /* 5,18 */
  5942. NULL, /* 5,19 */
  5943. NULL, /* 5,20 */
  5944. NULL, /* 5,21 */
  5945. NULL, /* 5,22 */
  5946. NULL, /* 5,23 */
  5947. NULL, /* 5,24 */
  5948. NULL, /* 5,25 */
  5949. NULL, /* 5,26 */
  5950. NULL, /* 5,27 */
  5951. NULL, /* 5,28 */
  5952. NULL, /* 5,29 */
  5953. NULL, /* 5,30 */
  5954. NULL, /* 5,31 */
  5955. NULL, /* 5,32 */
  5956. NULL, /* 5,33 */
  5957. NULL, /* 5,34 */
  5958. NULL, /* 5,35 */
  5959. NULL, /* 5,36 */
  5960. NULL, /* 5,37 */
  5961. NULL, /* 5,38 */
  5962. NULL, /* 5,39 */
  5963. NULL, /* 5,40 */
  5964. NULL, /* 5,41 */
  5965. NULL, /* 5,42 */
  5966. NULL, /* 5,43 */
  5967. NULL, /* 5,44 */
  5968. NULL, /* 5,45 */
  5969. NULL, /* 5,46 */
  5970. NULL, /* 5,47 */
  5971. NULL, /* 5,48 */
  5972. NULL, /* 5,49 */
  5973. xlhas, /* 6,0 latin/hebrew to us ascii */
  5974. xlhas, /* 6,1 latin/hebrew to uk ascii */
  5975. xlhas, /* 6,2 latin/hebrew to dutch nrc */
  5976. xlhas, /* 6,3 latin/hebrew to finnish ascii */
  5977. xlhas, /* 6,4 latin/hebrew to french nrc */
  5978. xlhas, /* 6,5 latin/hebrew to fr-canadian nrc */
  5979. xlhas, /* 6,6 latin/hebrew to german nrc */
  5980. xlhas, /* 6,7 latin/hebrew to italian nrc */
  5981. xlhas, /* 6,8 latin/hebrew to hungarian nrc */
  5982. xlhas, /* 6,9 latin/hebrew to norge/danish nrc */
  5983. xlhas, /* 6,10 latin/hebrew to portuguese nrc */
  5984. xlhas, /* 6,11 latin/hebrew to spanish nrc */
  5985. xlhas, /* 6,12 latin/hebrew to swedish nrc */
  5986. xlhas, /* 6,13 latin/hebrew to swiss nrc */
  5987. xlhl1, /* 6,14 latin/hebrew to latin-1 */
  5988. xlhas, /* 6,15 latin/hebrew to latin-2 */
  5989. xlhl1, /* 6,16 latin/hebrew to DEC MCS */
  5990. xlhas, /* 6,17 latin/hebrew to NeXT */
  5991. xlhas, /* 6,18 latin/hebrew to CP437 */
  5992. xlhas, /* 6,19 latin/hebrew to CP850 */
  5993. xlhas, /* 6,20 latin/hebrew to CP852 */
  5994. xlhas, /* 6,21 latin/hebrew to Macintosh Latin */
  5995. xlhas, /* 6,22 latin/hebrew to DGI */
  5996. xlhas, /* 6,23 latin/hebrew to HP */
  5997. xlhas, /* 6,24 latin/hebrew to Latin/Cyrillic */
  5998. xlhas, /* 6,25 latin/hebrew to CP866 */
  5999. NULL, /* 6,26 latin/hebrew to Short KOI */
  6000. xlhas, /* 6,27 latin/hebrew to Old KOI-8 Cyrillic */
  6001. NULL, /* 6,28 latin/hebrew to JIS-7 */
  6002. NULL, /* 6,29 latin/hebrew to Shift-JIS */
  6003. NULL, /* 6,30 latin/hebrew to J-EUC */
  6004. NULL, /* 6,31 latin/hebrew to DEC Kanji */
  6005. xlhh7, /* 6,32 latin/hebrew to Hebrew-7 */
  6006. NULL, /* 6,33 latin/hebrew to Latin/Hebrew */
  6007. xlh62, /* 6,34 latin/hebrew to CP862 Hebrew */
  6008. NULL, /* 6,35 latin/hebrew to ELOT 927 Greek */
  6009. xlhas, /* 6,36 latin/hebrew to Latin/Greek */
  6010. xlhas, /* 6,37 latin/hebrew to CP869 */
  6011. xlhas, /* 6,38 latin/hebrew to Latin-9 */
  6012. xlhas, /* 6,39 latin/hebrew to CP858 */
  6013. xlhas, /* 6,40 latin/hebrew to CP855 */
  6014. xlhas, /* 6,41 latin/hebrew to CP1251 */
  6015. xlhas, /* 6,42 latin/hebrew to Bulgarian */
  6016. xlhas, /* 6,43 latin/hebrew to CP1250 */
  6017. xlhas, /* 6,44 latin/hebrew to Mazovia */
  6018. NULL, /* 6,45 latin/hebrew to UCS-2 */
  6019. NULL, /* 6,46 latin/hebrew to UTF-8 */
  6020. NULL, /* 6,47 latin/hebrew to KOI8R */
  6021. NULL, /* 6,48 latin/hebrew to KOI8U */
  6022. xlhw1, /* 6,49 latin/hebrew to CP1252 */
  6023. xlgas, /* 7,0 latin/greek to us ascii */
  6024. xlgas, /* 7,1 latin/greek to uk ascii */
  6025. xlgas, /* 7,2 latin/greek to dutch nrc */
  6026. xlgas, /* 7,3 latin/greek to finnish ascii */
  6027. xlgas, /* 7,4 latin/greek to french nrc */
  6028. xlgas, /* 7,5 latin/greek to fr-canadian nrc */
  6029. xlgas, /* 7,6 latin/greek to german nrc */
  6030. xlgas, /* 7,7 latin/greek to italian nrc */
  6031. xlgas, /* 7,8 latin/greek to hungarian nrc */
  6032. xlgas, /* 7,9 latin/greek to norge/danish nrc */
  6033. xlgas, /* 7,10 latin/greek to portuguese nrc */
  6034. xlgas, /* 7,11 latin/greek to spanish nrc */
  6035. xlgas, /* 7,12 latin/greek to swedish nrc */
  6036. xlgas, /* 7,13 latin/greek to swiss nrc */
  6037. xlgas, /* 7,14 latin/greek to latin-1 */
  6038. xlgas, /* 7,15 latin/greek to latin-2 */
  6039. xlgas, /* 7,16 latin/greek to DEC MCS */
  6040. xlgas, /* 7,17 latin/greek to NeXT */
  6041. xlgas, /* 7,18 latin/greek to CP437 */
  6042. xlgas, /* 7,19 latin/greek to CP850 */
  6043. xlgas, /* 7,20 latin/greek to CP852 */
  6044. xlgas, /* 7,21 latin/greek to Macintosh Latin */
  6045. xlgas, /* 7,22 latin/greek to DGI */
  6046. xlgas, /* 7,23 latin/greek to HP */
  6047. xleft160, /* 7,24 latin/greek to Latin/Cyrillic */
  6048. xleft128, /* 7,25 latin/greek to CP866 */
  6049. xassk, /* 7,26 latin/greek to Short KOI */
  6050. xleft160, /* 7,27 latin/greek to Old KOI-8 Greek */
  6051. NULL, /* 7,28 latin/greek to JIS-7 */
  6052. NULL, /* 7,29 latin/greek to Shift-JIS */
  6053. NULL, /* 7,30 latin/greek to J-EUC */
  6054. NULL, /* 7,31 latin/greek to DEC Kanji */
  6055. NULL, /* 7,32 latin/greek to Hebrew-7 */
  6056. xlgas, /* 7,33 latin/greek to Latin/Hebrew */
  6057. xlgas, /* 7,34 latin/greek to CP862 Hebrew */
  6058. xlgeg, /* 7,35 latin/greek to ELOT 927 Greek */
  6059. NULL, /* 7,36 latin/greek to Latin/Greek */
  6060. xlg69, /* 7,37 latin/greek to CP869 */
  6061. xlgas, /* 7,38 latin/greek to Latin-9 */
  6062. xlgas, /* 7,39 latin/greek to CP858 */
  6063. xleft128, /* 7,40 latin/greek to CP855 */
  6064. xleft128, /* 7,41 latin/greek to CP1251 */
  6065. xleft128, /* 7,42 latin/greek to Bulgarian */
  6066. xleft128, /* 7,43 latin/greek to CP1250 */
  6067. xleft128, /* 7,44 latin/greek to Mazovia */
  6068. NULL, /* 7,45 latin/greek to UCS-2 */
  6069. NULL, /* 7,46 latin/greek to UTF-8 */
  6070. NULL, /* 7,47 latin/greek to KOI8R */
  6071. NULL, /* 7,48 latin/greek to KOI8U */
  6072. xlgw1, /* 7,49 latin/greek to CP1252 */
  6073. zl9as, /* 8,0 latin-9 to us ascii */
  6074. xl1uk, /* 8,1 latin-9 to uk ascii */
  6075. xl1du, /* 8,2 latin-9 to dutch nrc */
  6076. xl1fi, /* 8,3 latin-9 to finnish nrc */
  6077. xl1fr, /* 8,4 latin-9 to french nrc */
  6078. xl1fc, /* 8,5 latin-9 to fr-canadian nrc */
  6079. xl1ge, /* 8,6 latin-9 to german nrc */
  6080. xl1it, /* 8,7 latin-9 to italian nrc */
  6081. xl1hu, /* 8,8 latin-9 to hungarian nrc */
  6082. xl1no, /* 8,9 latin-9 to norge/danish nrc */
  6083. xl1po, /* 8,10 latin-9 to portuguese nrc */
  6084. xl1sp, /* 8,11 latin-9 to spanish nrc */
  6085. xl1sw, /* 8,12 latin-9 to swedish nrc */
  6086. xl1ch, /* 8,13 latin-9 to swiss nrc */
  6087. NULL, /* 8,14 latin-9 to latin-1 */
  6088. xl1l2, /* 8,15 latin-9 to latin-2 */
  6089. xl9dm, /* 8,16 latin-9 to DEC MCS */
  6090. xl9ne, /* 8,17 latin-9 to NeXT */
  6091. xl143, /* 8,18 latin-9 to CP437 */
  6092. xl185, /* 8,19 latin-9 to CP850 */
  6093. xl152, /* 8,20 latin-9 to CP852 */
  6094. xl1aq, /* 8,21 latin-9 to Macintosh Latin */
  6095. xl1dg, /* 8,22 latin-9 to DGI */
  6096. xl1r8, /* 8,23 latin-9 to HP Roman8 */
  6097. zl1as, /* 8,24 latin-9 to Latin/Cyrillic */
  6098. zl1as, /* 8,25 latin-9 to CP866 */
  6099. xl1sk, /* 8,26 latin-9 to Short KOI */
  6100. zl1as, /* 8,27 latin-9 to Old KOI-8 Cyrillic */
  6101. NULL, /* 8,28 latin-9 to JIS-7 */
  6102. NULL, /* 8,29 latin-9 to Shift-JIS */
  6103. NULL, /* 8,30 latin-9 to J-EUC */
  6104. NULL, /* 8,31 latin-9 to DEC Kanji */
  6105. xl1h7, /* 8,32 latin-9 to Hebrew-7 */
  6106. xl1lh, /* 8,33 latin-9 to Latin/Hebrew */
  6107. xl162, /* 8,34 latin-9 to CP862 Hebrew */
  6108. xl1eg, /* 8,35 latin-9 to ELOT 927 Greek */
  6109. xl1lg, /* 8,36 latin-9 to Latin/Greek */
  6110. xl169, /* 8,37 latin-9 to CP869 */
  6111. NULL, /* 8,38 latin-9 to Latin9 */
  6112. xl958, /* 8,39 latin-9 to CP858 */
  6113. zl1as, /* 8,40 latin-9 to CP855 */
  6114. zl1as, /* 8,41 latin-9 to CP1251 */
  6115. xl1as, /* 8,42 latin-9 to Bulgarian */
  6116. xl91250, /* 8,43 latin-9 to CP1250 */
  6117. xl9mz, /* 8,44 latin-9 to Mazovia */
  6118. NULL, /* 8,45 latin-9 to UCS-2 */
  6119. NULL, /* 8,46 latin-9 to UTF-8 */
  6120. zl1as, /* 8,47 latin-9 to KOI8-R */
  6121. zl1as, /* 8,48 latin-9 to KOI8-U */
  6122. xl9w1, /* 8,49 latin-9 to CP1252 */
  6123. NULL, /* 9,00 Unicode... */
  6124. NULL, /* 9,01 */
  6125. NULL, /* 9,02 */
  6126. NULL, /* 9,03 */
  6127. NULL, /* 9,04 */
  6128. NULL, /* 9,05 */
  6129. NULL, /* 9,06 */
  6130. NULL, /* 9,07 */
  6131. NULL, /* 9,08 */
  6132. NULL, /* 9,09 */
  6133. NULL, /* 9,10 */
  6134. NULL, /* 9,11 */
  6135. NULL, /* 9,12 */
  6136. NULL, /* 9,13 */
  6137. NULL, /* 9,14 */
  6138. NULL, /* 9,15 */
  6139. NULL, /* 9,16 */
  6140. NULL, /* 9,17 */
  6141. NULL, /* 9,18 */
  6142. NULL, /* 9,19 */
  6143. NULL, /* 9,20 */
  6144. NULL, /* 9,21 */
  6145. NULL, /* 9,22 */
  6146. NULL, /* 9,23 */
  6147. NULL, /* 9,24 */
  6148. NULL, /* 9,25 */
  6149. NULL, /* 9,26 */
  6150. NULL, /* 9,27 */
  6151. NULL, /* 9,28 */
  6152. NULL, /* 9,29 */
  6153. NULL, /* 9,30 */
  6154. NULL, /* 9,31 */
  6155. NULL, /* 9,32 */
  6156. NULL, /* 9,33 */
  6157. NULL, /* 9,34 */
  6158. NULL, /* 9,35 */
  6159. NULL, /* 9,36 */
  6160. NULL, /* 9,37 */
  6161. NULL, /* 9,38 */
  6162. NULL, /* 9,39 */
  6163. NULL, /* 9,40 */
  6164. NULL, /* 9,41 */
  6165. NULL, /* 9,42 */
  6166. NULL, /* 9,43 */
  6167. NULL, /* 9,44 */
  6168. NULL, /* 9,45 */
  6169. NULL, /* 9,46 */
  6170. NULL, /* 9,47 */
  6171. NULL, /* 9,48 */
  6172. NULL, /* 9,49 */
  6173. NULL, /* 10,00 */
  6174. NULL, /* 10,01 */
  6175. NULL, /* 10,02 */
  6176. NULL, /* 10,03 */
  6177. NULL, /* 10,04 */
  6178. NULL, /* 10,05 */
  6179. NULL, /* 10,06 */
  6180. NULL, /* 10,07 */
  6181. NULL, /* 10,08 */
  6182. NULL, /* 10,09 */
  6183. NULL, /* 10,10 */
  6184. NULL, /* 10,11 */
  6185. NULL, /* 10,12 */
  6186. NULL, /* 10,13 */
  6187. NULL, /* 10,14 */
  6188. NULL, /* 10,15 */
  6189. NULL, /* 10,16 */
  6190. NULL, /* 10,17 */
  6191. NULL, /* 10,18 */
  6192. NULL, /* 10,19 */
  6193. NULL, /* 10,20 */
  6194. NULL, /* 10,21 */
  6195. NULL, /* 10,22 */
  6196. NULL, /* 10,23 */
  6197. NULL, /* 10,24 */
  6198. NULL, /* 10,25 */
  6199. NULL, /* 10,26 */
  6200. NULL, /* 10,27 */
  6201. NULL, /* 10,28 */
  6202. NULL, /* 10,29 */
  6203. NULL, /* 10,30 */
  6204. NULL, /* 10,31 */
  6205. NULL, /* 10,32 */
  6206. NULL, /* 10,33 */
  6207. NULL, /* 10,34 */
  6208. NULL, /* 10,35 */
  6209. NULL, /* 10,36 */
  6210. NULL, /* 10,37 */
  6211. NULL, /* 10,38 */
  6212. NULL, /* 10,39 */
  6213. NULL, /* 10,40 */
  6214. NULL, /* 10,41 */
  6215. NULL, /* 10,42 */
  6216. NULL, /* 10,43 */
  6217. NULL, /* 10,44 */
  6218. NULL, /* 10,45 */
  6219. NULL, /* 10,46 */
  6220. NULL, /* 10,47 */
  6221. NULL, /* 10,48 */
  6222. NULL /* 10,49 */
  6223. };
  6224. int nxlr = (sizeof(xlr) / sizeof(CHAR *));
  6225. /*
  6226. Translation function table for sending files.
  6227. Array of pointers to functions for translating from the local file
  6228. character set to the transfer character set. Indexed in the same
  6229. way as the xlr array above, but with the indices reversed.
  6230. */
  6231. #ifdef CK_ANSIC
  6232. CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])(CHAR) =
  6233. #else
  6234. CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])() =
  6235. #endif /* CK_ANSIC */
  6236. {
  6237. NULL, /* 0,0 us ascii to transparent */
  6238. NULL, /* 0,1 uk ascii to transparent */
  6239. NULL, /* 0,2 dutch nrc to transparent */
  6240. NULL, /* 0,3 finnish nrc to transparent */
  6241. NULL, /* 0,4 french nrc to transparent */
  6242. NULL, /* 0,5 fr-canadian nrc to transparent */
  6243. NULL, /* 0,6 german nrc to transparent */
  6244. NULL, /* 0,7 hungarian nrc to transparent */
  6245. NULL, /* 0,8 italian nrc to transparent */
  6246. NULL, /* 0,9 norge/danish nrc to transparent */
  6247. NULL, /* 0,10 portuguese nrc to transparent */
  6248. NULL, /* 0,11 spanish nrc to transparent */
  6249. NULL, /* 0,12 swedish nrc to transparent */
  6250. NULL, /* 0,13 swiss nrc to transparent */
  6251. NULL, /* 0,14 latin-1 to transparent */
  6252. NULL, /* 0,15 latin-2 to transparent */
  6253. NULL, /* 0,16 DEC MCS to transparent */
  6254. NULL, /* 0,17 NeXT to transparent */
  6255. NULL, /* 0,18 CP437 to transparent */
  6256. NULL, /* 0,19 CP850 to transparent */
  6257. NULL, /* 0,20 CP852 to transparent */
  6258. NULL, /* 0,21 Macintosh Latin to transparent */
  6259. NULL, /* 0,22 DGI to transparent */
  6260. NULL, /* 0,23 HP to transparent */
  6261. NULL, /* 0,24 Latin/Cyrillic to transparent */
  6262. NULL, /* 0,25 CP866 to transparent */
  6263. NULL, /* 0,26 Short KOI to transparent */
  6264. NULL, /* 0,27 Old KOI-8 to transparent */
  6265. NULL, /* 0,28 JIS-7 to transparent */
  6266. NULL, /* 0,29 Shift JIS to transparent */
  6267. NULL, /* 0,30 Japanese EUC to transparent */
  6268. NULL, /* 0,31 DEC Kanji to transparent */
  6269. NULL, /* 0,32 Hebrew-7 to transparent */
  6270. NULL, /* 0,33 Latin/Hebrew to transparent */
  6271. NULL, /* 0,34 CP862 Hebrew to transparent */
  6272. NULL, /* 0,35 ELOT 927 Greek to transparent */
  6273. NULL, /* 0,36 Latin/Greek to transparent */
  6274. NULL, /* 0,37 CP869 to transparent */
  6275. NULL, /* 0,38 Latin-9 to transparent */
  6276. NULL, /* 0,39 CP858 to transparent */
  6277. NULL, /* 0,40 CP855 to transparent */
  6278. NULL, /* 0,41 CP1251 to transparent */
  6279. NULL, /* 0,42 Bulgarian to transparent */
  6280. NULL, /* 0,43 CP1250 to transparent */
  6281. NULL, /* 0,44 Mazovia to transparent */
  6282. NULL, /* 0,45 UCS-2 to transparent */
  6283. NULL, /* 0,46 UTF-8 to transparent */
  6284. NULL, /* 0,47 KOI8R to transparent */
  6285. NULL, /* 0,48 KOI8U to transparent */
  6286. NULL, /* 0,49 CP1252 to transparent */
  6287. NULL, /* 1,0 us ascii to ascii */
  6288. NULL, /* 1,1 uk ascii to ascii */
  6289. xduas, /* 1,2 dutch nrc to ascii */
  6290. xfias, /* 1,3 finnish nrc to ascii */
  6291. xfras, /* 1,4 french nrc to ascii */
  6292. xfcas, /* 1,5 french canadian nrc to ascii */
  6293. xgeas, /* 1,6 german nrc to ascii */
  6294. xhuas, /* 1,7 hungarian nrc to ascii */
  6295. xitas, /* 1,8 italian nrc to ascii */
  6296. xnoas, /* 1,9 norwegian/danish nrc to ascii */
  6297. xpoas, /* 1,10 portuguese nrc to ascii */
  6298. xspas, /* 1,11 spanish nrc to ascii */
  6299. xswas, /* 1,12 swedish nrc to ascii */
  6300. xchas, /* 1,13 swiss nrc to ascii */
  6301. xl1as, /* 1,14 latin-1 to ascii */
  6302. xl2as, /* 1,15 latin-2 to ascii */
  6303. xdmas, /* 1,16 dec mcs to ascii */
  6304. xneas, /* 1,17 NeXT to ascii */
  6305. x43as, /* 1,18 CP437 to ascii */
  6306. x85as, /* 1,19 CP850 to ascii */
  6307. x52as, /* 1,20 CP850 to ascii */
  6308. xaqas, /* 1,21 Macintosh Latin to ascii */
  6309. xdgas, /* 1,22 DGI to ascii */
  6310. xr8as, /* 1,23 HP to ASCII */
  6311. xlcas, /* 1,24 Latin/Cyrillic to ASCII */
  6312. xacas, /* 1,25 CP866 to ASCII */
  6313. xskas, /* 1,26 Short KOI to ASCII */
  6314. xk8as, /* 1,27 Old KOI-8 Cyrillic to ASCII */
  6315. NULL, /* 1,28 */
  6316. NULL, /* 1,29 */
  6317. NULL, /* 1,30 */
  6318. NULL, /* 1,31 */
  6319. xh7as, /* 1,32 Hebrew-7 to ASCII */
  6320. xlhas, /* 1,33 Latin/Hebrew to ASCII */
  6321. x62as, /* 1,34 CP862 Hebrew to ASCII */
  6322. xegas, /* 1,35 ELOT 927 Greek to ASCII */
  6323. xlgas, /* 1,36 Latin/Greek to ASCII */
  6324. x69as, /* 1,37 CP869 to ASCII */
  6325. xl9as, /* 1,38 Latin-9 to ASCII */
  6326. x58as, /* 1,39 CP858 to ASCII */
  6327. x55as, /* 1,40 CP855 to ASCII */
  6328. x1251as, /* 1,41 CP1251 to ASCII */
  6329. xleft128, /* 1,42 Bulgarian to ASCII */
  6330. x1250as, /* 1,43 CP1250 to ASCII */
  6331. xmzas, /* 1,44 Mazovia to ASCII */
  6332. NULL, /* 1,45 UCS-2 to ASCII */
  6333. NULL, /* 1,46 UTF-8 to ASCII */
  6334. xk8as, /* 1,47 KOI8R to ASCII */
  6335. xk8as, /* 1,48 KOI8U to ASCII */
  6336. xw1as, /* 1,49 CP1252 to ASCII */
  6337. NULL, /* 2,0 us ascii to latin-1 */
  6338. xukl1, /* 2,1 uk ascii to latin-1 */
  6339. xdul1, /* 2,2 dutch nrc to latin-1 */
  6340. xfil1, /* 2,3 finnish nrc to latin-1 */
  6341. xfrl1, /* 2,4 french nrc to latin-1 */
  6342. xfcl1, /* 2,5 french canadian nrc to latin-1 */
  6343. xgel1, /* 2,6 german nrc to latin-1 */
  6344. xhul1, /* 2,7 hungarian nrc to latin-1 */
  6345. xitl1, /* 2,8 italian nrc to latin-1 */
  6346. xnol1, /* 2,9 norwegian/danish nrc to latin-1 */
  6347. xpol1, /* 2,10 portuguese nrc to latin-1 */
  6348. xspl1, /* 2,11 spanish nrc to latin-1 */
  6349. xswl1, /* 2,12 swedish nrc to latin-1 */
  6350. xchl1, /* 2,13 swiss nrc to latin-1 */
  6351. NULL, /* 2,14 latin-1 to latin-1 */
  6352. xl2l1, /* 2,15 latin-2 to latin-1 */
  6353. xdml1, /* 2,16 dec mcs to latin-1 */
  6354. xnel1, /* 2,17 NeXT to Latin-1 */
  6355. x43l1, /* 2,18 CP437 to Latin-1 */
  6356. x85l1, /* 2,19 CP850 to Latin-1 */
  6357. x52l1, /* 2,20 CP852 to Latin-1 */
  6358. xaql1, /* 2,21 Macintosh Latin to Latin-1 */
  6359. xdgl1, /* 2,22 DGI to Latin-1 */
  6360. xr8l1, /* 2,23 HP to Latin-1 */
  6361. xlcas, /* 2,24 Latin/Cyrillic to Latin-1 */
  6362. xacas, /* 2,25 CP866 to Latin-1 */
  6363. xskas, /* 2,26 Short KOI to Latin-1 */
  6364. xk8as, /* 2,27 Old KOI-8 Cyrillic to Latin-1 */
  6365. NULL, /* 2,28 Kanji ... */
  6366. NULL, /* 2,29 */
  6367. NULL, /* 2,30 */
  6368. NULL, /* 2,31 */
  6369. xh7as, /* 2,32 Hebrew-7 to Latin-1 */
  6370. xlhl1, /* 2,33 Latin/Hebrew to Latin-1 */
  6371. x62l1, /* 2,34 CP862 Hebrew to Latin-1 */
  6372. xegas, /* 2,35 ELOT 927 Greek to Latin-1 */
  6373. xlgl1, /* 2,36 Latin/Greek to Latin-1 */
  6374. NULL, /* 2,37 CP869 to Latin-1 */
  6375. NULL, /* 2,38 Latin-9 to Latin-1 */
  6376. x58l1, /* 2,39 CP858 to Latin-1 */
  6377. x55as, /* 2,40 CP855 to Latin-1 */
  6378. x1251as, /* 2,41 CP1251 to Latin-1 */
  6379. xleft128, /* 2,42 Bulgarian to Latin-1 */
  6380. x1250l1, /* 2,43 CP1250 to Latin-1 */
  6381. xmzl1, /* 2,44 Mazovia to Latin-1 */
  6382. NULL, /* 2,45 UCS-2 to Latin-1 */
  6383. NULL, /* 2,46 UTF-8 to Latin-1 */
  6384. xk8as, /* 2,47 KOI8R to Latin-1 */
  6385. xk8as, /* 2,48 KOI8U to Latin-1 */
  6386. xw1l1, /* 2,49 CP1252 to Latin-1 */
  6387. NULL, /* 3,0 us ascii to latin-2 */
  6388. NULL, /* 3,1 uk ascii to latin-2 */
  6389. xduas, /* 3,2 dutch nrc to latin-2 */
  6390. xfias, /* 3,3 finnish nrc to latin-2 */
  6391. xfras, /* 3,4 french nrc to latin-2 */
  6392. xfcas, /* 3,5 french canadian nrc to latin-2 */
  6393. xgel2, /* 3,6 german nrc to latin-2 */
  6394. xhul2, /* 3,7 hungarian nrc to latin-2 */
  6395. xitas, /* 3,8 italian nrc to latin-2 */
  6396. xnoas, /* 3,9 norwegian/danish nrc to latin-2 */
  6397. xpoas, /* 3,10 portuguese nrc to latin-2 */
  6398. xspas, /* 3,11 spanish nrc to latin-2 */
  6399. xswas, /* 3,12 swedish nrc to latin-2 */
  6400. xchas, /* 3,13 swiss nrc to latin-2 */
  6401. xl1l2, /* 3,14 latin-1 to latin-2 */
  6402. NULL, /* 3,15 latin-2 to latin-2 */
  6403. xl1l2, /* 3,16 dec mcs to latin-2 */
  6404. xnel2, /* 3,17 NeXT to Latin-2 */
  6405. x43l2, /* 3,18 CP437 to Latin-2 */
  6406. x85l2, /* 3,19 CP850 to Latin-2 */
  6407. x52l2, /* 3,20 CP852 to Latin-2 */
  6408. xaql2, /* 3,21 Macintosh Latin to Latin-2 */
  6409. xdgl2, /* 3,22 DGI to Latin-2 */
  6410. xr8l2, /* 3,23 HP to Latin-2 */
  6411. xlcas, /* 3,24 Latin/Cyrillic to Latin-2 */
  6412. xacas, /* 3,25 CP866 to Latin-2 */
  6413. xskas, /* 3,26 Short KOI to Latin-2 */
  6414. xk8as, /* 3,27 Old KOI-8 Cyrillic to Latin-2 */
  6415. NULL, /* 3,28 Kanji ... */
  6416. NULL, /* 3,29 */
  6417. NULL, /* 3,30 */
  6418. NULL, /* 3,31 */
  6419. xh7as, /* 3,32 Hebrew-7 to Latin-2 */
  6420. xlhas, /* 3,33 Latin/Hebrew to Latin-2 */
  6421. x62as, /* 3,34 CP862 Hebrew to Latin-2 */
  6422. xegas, /* 3,35 ELOT 927 Greek to Latin-2 */
  6423. xl2lg, /* 3,36 Latin/Greek to Latin-2 */
  6424. xleft128, /* 3,37 CP869 to Latin-2 */
  6425. xl9l2, /* 3,38 Latin-9 to Latin-2 */
  6426. x58l2, /* 3,39 CP858 to Latin-2 */
  6427. x55as, /* 3,40 CP855 to Latin-2 */
  6428. x1251as, /* 3,41 CP1251 to Latin-2 */
  6429. xleft128, /* 3,42 Bulgarian to Latin-2 */
  6430. x1250l2, /* 3,43 CP1250 to Latin-2 */
  6431. xmzl2, /* 3,44 Mazovia to Latin-2 */
  6432. NULL, /* 3,45 UCS-2 to Latin-2 */
  6433. NULL, /* 3,46 UTF-8 to Latin-2 */
  6434. xk8as, /* 3,47 KOI8R to Latin-2 */
  6435. xk8as, /* 3,48 KOI8U to Latin-2 */
  6436. xw1l2, /* 3,49 CP1252 to latin-2 */
  6437. xaslc, /* 4,0 us ascii to latin/cyrillic */
  6438. xaslc, /* 4,1 uk ascii to latin/cyrillic */
  6439. xduas, /* 4,2 dutch nrc to latin/cyrillic */
  6440. xfias, /* 4,3 finnish nrc to latin/cyrillic */
  6441. xfras, /* 4,4 french nrc to latin/cyrillic */
  6442. xfcas, /* 4,5 french canadian nrc to latin/cyrillic */
  6443. xgeas, /* 4,6 german nrc to latin/cyrillic */
  6444. xhuas, /* 4,7 hungarian nrc to latin/cyrillic */
  6445. xitas, /* 4,8 italian nrc to latin/cyrillic */
  6446. xnoas, /* 4,9 norge/danish nrc to latin/cyrillic */
  6447. xpoas, /* 4,10 portuguese nrc to latin/cyrillic */
  6448. xspas, /* 4,11 spanish nrc to latin/cyrillic */
  6449. xswas, /* 4,12 swedish nrc to latin/cyrillic */
  6450. xchas, /* 4,13 swiss nrc to latin/cyrillic */
  6451. xl1as, /* 4,14 latin-1 to latin/cyrillic */
  6452. xl2as, /* 4,15 latin-2 to latin/cyrillic */
  6453. xdmas, /* 4,16 dec mcs to latin/cyrillic */
  6454. xneas, /* 4,17 NeXT to latin/cyrillic */
  6455. x43as, /* 4,18 CP437 to latin/cyrillic */
  6456. x85as, /* 4,19 CP850 to latin/cyrillic */
  6457. x52as, /* 4,20 CP852 to latin/cyrillic */
  6458. xaqas, /* 4,21 Macintosh Latin to latin/cyrillic */
  6459. xdgas, /* 4,22 DGI to Latin/Cyrillic */
  6460. xr8as, /* 4,23 HP to Latin/Cyrillic */
  6461. NULL, /* 4,24 Latin/Cyrillic to Latin/Cyrillic */
  6462. xaclc, /* 4,25 CP866 to Latin/Cyrillic */
  6463. xskcy, /* 4,26 Short KOI to Latin/Cyrillic */
  6464. xk8lc, /* 4,27 Old KOI-8 Cyrillic to Latin/Cyrillic */
  6465. NULL, /* 4,28 Kanji... */
  6466. NULL, /* 4,29 */
  6467. NULL, /* 4,30 */
  6468. NULL, /* 4,31 */
  6469. xh7as, /* 4,32 Hebrew-7 to Latin/Cyrillic */
  6470. xlhas, /* 4,33 Latin/Hebrew to Latin/Cyrillic */
  6471. x62as, /* 4,34 CP862 Hebrew to Latin/Cyrillic */
  6472. xegas, /* 4,35 ELOT 927 Greek to Latin/Cyrillic */
  6473. xleft160, /* 4,36 Latin/Greek to Latin/Cyrillic */
  6474. xleft128, /* 4,37 CP869 to Latin/Cyrillic */
  6475. xl1as, /* 4,38 latin-9 to latin/cyrillic */
  6476. xleft128, /* 4,39 CP858 to Latin/Cyrillic */
  6477. x55lc, /* 4,40 CP855 to Latin/Cyrillic */
  6478. x1251lc, /* 4,41 CP1251 to Latin/Cyrillic */
  6479. xbulc, /* 4,42 Bulgarian to Latin/Cyrillic */
  6480. x1250as, /* 4,43 CP1250 to Latin/Cyrillic */
  6481. xmzas, /* 4,44 Mazovia to Latin/Cyrillic */
  6482. NULL, /* 4,45 UCS-2 to Latin/Cyrillic */
  6483. NULL, /* 4,46 UTF-8 to Latin/Cyrillic */
  6484. xkrlc, /* 4,47 KOI8R to Latin/Cyrillic */
  6485. xkulc, /* 4,48 KOI8U to Latin/Cyrillic */
  6486. xw1lc, /* 4,49 CP1252 to Latin/Cyrillic */
  6487. NULL, /* 5,00 */
  6488. NULL, /* 5,01 */
  6489. NULL, /* 5,02 */
  6490. NULL, /* 5,03 */
  6491. NULL, /* 5,04 */
  6492. NULL, /* 5,05 */
  6493. NULL, /* 5,06 */
  6494. NULL, /* 4.07 */
  6495. NULL, /* 5,08 */
  6496. NULL, /* 5,09 */
  6497. NULL, /* 5,10 */
  6498. NULL, /* 5,11 */
  6499. NULL, /* 5,12 */
  6500. NULL, /* 5,13 */
  6501. NULL, /* 5,14 */
  6502. NULL, /* 5,15 */
  6503. NULL, /* 5,16 */
  6504. NULL, /* 5,17 */
  6505. NULL, /* 5,18 */
  6506. NULL, /* 5,19 */
  6507. NULL, /* 5,20 */
  6508. NULL, /* 5,21 */
  6509. NULL, /* 5,22 */
  6510. NULL, /* 5,23 */
  6511. NULL, /* 5,24 */
  6512. NULL, /* 5,25 */
  6513. NULL, /* 5,26 */
  6514. NULL, /* 5,27 */
  6515. NULL, /* 5,28 */
  6516. NULL, /* 5,29 */
  6517. NULL, /* 5,30 */
  6518. NULL, /* 5,31 */
  6519. NULL, /* 5,32 */
  6520. NULL, /* 5,33 */
  6521. NULL, /* 5,34 */
  6522. NULL, /* 5,35 */
  6523. NULL, /* 5,36 */
  6524. NULL, /* 5,37 */
  6525. NULL, /* 5,38 */
  6526. NULL, /* 5,39 */
  6527. NULL, /* 5,40 */
  6528. NULL, /* 5,41 */
  6529. NULL, /* 5,42 */
  6530. NULL, /* 5,43 */
  6531. NULL, /* 5,44 */
  6532. NULL, /* 5,45 */
  6533. NULL, /* 5,46 */
  6534. NULL, /* 5,47 */
  6535. NULL, /* 5,48 */
  6536. NULL, /* 5,49 */
  6537. NULL, /* 6,0 us ascii to Latin/Hebrew */
  6538. NULL, /* 6,1 uk ascii to Latin/Hebrew */
  6539. xduas, /* 6,2 dutch nrc to Latin/Hebrew */
  6540. xfias, /* 6,3 finnish nrc to Latin/Hebrew */
  6541. xfras, /* 6,4 french nrc to Latin/Hebrew */
  6542. xfcas, /* 6,5 french canadian nrc to Latin/Hebrew */
  6543. xgeas, /* 6,6 german nrc to Latin/Hebrew */
  6544. xhuas, /* 6,7 hungarian nrc to Latin/Hebrew */
  6545. xitas, /* 6,8 italian nrc to Latin/Hebrew */
  6546. xnoas, /* 6,9 norge/danish nrc to Latin/Hebrew */
  6547. xpoas, /* 6,10 portuguese nrc to Latin/Hebrew */
  6548. xspas, /* 6,11 spanish nrc to Latin/Hebrew */
  6549. xswas, /* 6,12 swedish nrc to Latin/Hebrew */
  6550. xchas, /* 6,13 swiss nrc to Latin/Hebrew */
  6551. xl1lh, /* 6,14 latin-1 to Latin/Hebrew */
  6552. xl2as, /* 6,15 latin-2 to Latin/Hebrew */
  6553. xdmas, /* 6,16 dec mcs to Latin/Hebrew */
  6554. xneas, /* 6,17 NeXT to Latin/Hebrew */
  6555. x43as, /* 6,18 CP437 to Latin/Hebrew */
  6556. x85as, /* 6,19 CP850 to Latin/Hebrew */
  6557. x52as, /* 6,20 CP852 to Latin/Hebrew */
  6558. xaqas, /* 6,21 Macintosh Latin to Latin/Hebrew */
  6559. xdgas, /* 6,22 DGI to Latin/Hebrew */
  6560. xr8as, /* 6,23 HP to Latin/Hebrew */
  6561. xlcas, /* 6,24 Latin/Cyrillic to Latin/Hebrew */
  6562. xacas, /* 6,25 CP866 to Latin/Hebrew */
  6563. xskas, /* 6,26 Short KOI to Latin/Hebrew */
  6564. xk8as, /* 6,27 Old KOI-8 Cyrillic to Latin/Hebrew */
  6565. NULL, /* 6,28 Kanji... */
  6566. NULL, /* 6,29 */
  6567. NULL, /* 6,30 */
  6568. NULL, /* 6,31 */
  6569. xh7lh, /* 6,32 Hebrew-7 to Latin/Hebrew */
  6570. NULL, /* 6,33 Latin/Hebrew to Latin/Hebrew */
  6571. x62lh, /* 6,34 CP862 Hebrew to Latin/Hebrew */
  6572. xegas, /* 6,35 ELOT 927 Greek to Latin/Hebrew */
  6573. xlgas, /* 6,36 Latin/Greek to Latin/Hebrew */
  6574. x69as, /* 6,37 CP869 to Latin/Hebrew */
  6575. xl1as, /* 6,38 latin-9 to Latin/Hebrew */
  6576. x58as, /* 6,39 CP858 to Latin/Hebrew */
  6577. x55as, /* 6,40 CP855 to Latin/Hebrew */
  6578. x1251as, /* 6,41 CP1251 to Latin/Hebrew */
  6579. xleft128, /* 6,42 Bulgarian to Latin/Hebrew */
  6580. x1250as, /* 6,43 CP1250 to Latin/Hebrew */
  6581. xmzas, /* 6,44 Mazovia to Latin/Hebrew */
  6582. NULL, /* 6,45 UCS-2 to Latin/Hebrew */
  6583. NULL, /* 6,46 UTF-8 to Latin/Hebrew */
  6584. NULL, /* 6,47 KOI8R to Latin/Hebrew */
  6585. NULL, /* 6,48 KOI8U to Latin/Hebrew */
  6586. xw1lh, /* 6,49 CP1252 to Latin/Hebrew */
  6587. NULL, /* 7,0 us ascii to Latin/Greek */
  6588. NULL, /* 7,1 uk ascii to Latin/Greek */
  6589. xduas, /* 7,2 dutch nrc to Latin/Greek */
  6590. xfias, /* 7,3 finnish nrc to Latin/Greek */
  6591. xfras, /* 7,4 french nrc to Latin/Greek */
  6592. xfcas, /* 7,5 french canadian nrc to Latin/Greek */
  6593. xgeas, /* 7,6 german nrc to Latin/Greek */
  6594. xhuas, /* 7,7 hungarian nrc to Latin/Greek */
  6595. xitas, /* 7,8 italian nrc to Latin/Greek */
  6596. xnoas, /* 7,9 norge/danish nrc to Latin/Greek */
  6597. xpoas, /* 7,10 portuguese nrc to Latin/Greek */
  6598. xspas, /* 7,11 spanish nrc to Latin/Greek */
  6599. xswas, /* 7,12 swedish nrc to Latin/Greek */
  6600. xchas, /* 7,13 swiss nrc to Latin/Greek */
  6601. xl1lg, /* 7,14 latin-1 to Latin/Greek */
  6602. xl2lg, /* 7,15 latin-2 to Latin/Greek */
  6603. xl1lg, /* 7,16 dec mcs to Latin/Greek */
  6604. xneas, /* 7,17 NeXT to Latin/Greek */
  6605. xleft128, /* 7,18 CP437 to Latin/Greek */
  6606. x85as, /* 7,19 CP850 to Latin/Greek */
  6607. x52as, /* 7,20 CP852 to Latin/Greek */
  6608. xaqas, /* 7,21 Macintosh Latin to Latin/Greek */
  6609. xdgas, /* 7,22 DGI to Latin/Greek */
  6610. xr8as, /* 7,23 HP to Latin/Greek */
  6611. xleft160, /* 7,24 Latin/Cyrillic to Latin/Greek */
  6612. xleft128, /* 7,25 CP866 to Latin/Greek */
  6613. xskas, /* 7,26 Short KOI to Latin/Greek */
  6614. xk8as, /* 7,27 Old KOI-8 Cyrillic to Latin/Greek */
  6615. NULL, /* 7,28 Kanji... */
  6616. NULL, /* 7,29 */
  6617. NULL, /* 7,30 */
  6618. NULL, /* 7,31 */
  6619. xh7as, /* 7,32 Hebrew-7 to Latin/Greek */
  6620. NULL, /* 7,33 Latin/Hebrew to Latin/Greek */
  6621. x62as, /* 7,34 CP862 Hebrew to Latin/Greek */
  6622. xeglg, /* 7,35 ELOT 927 Greek to Latin/Greek */
  6623. NULL, /* 7,36 Latin/Greek to Latin/Greek */
  6624. x69lg, /* 7,37 CP869 to Latin/Greek */
  6625. xl1as, /* 7,38 latin-9 to Latin/Greek */
  6626. xl1as, /* 7,39 latin-9 to Latin/Hebrew*/
  6627. xleft128, /* 7,40 CP855 to Latin/Greek */
  6628. xleft128, /* 7,41 CP1251 to Latin/Greek */
  6629. xleft128, /* 7,42 Bulgarian to Latin/Greek */
  6630. x1250as, /* 7,43 CP1250 to Latin/Greek */
  6631. xmzas, /* 7,44 Mazovia to Latin/Greek */
  6632. NULL, /* 7,45 UCS-2 to Latin/Greek */
  6633. NULL, /* 7,46 UTF-8 to Latin/Greek */
  6634. NULL, /* 7,47 KOI8R to Latin/Greek */
  6635. NULL, /* 7,48 KOI8U to Latin/Greek */
  6636. xw1lg, /* 7,49 CP1252 to Latin/Greek */
  6637. NULL, /* 8,0 us ascii to latin-9 */
  6638. xukl1, /* 8,1 uk ascii to latin-9 */
  6639. xdul1, /* 8,2 dutch nrc to latin-9 */
  6640. xfil1, /* 8,3 finnish nrc to latin-9 */
  6641. xfrl1, /* 8,4 french nrc to latin-9 */
  6642. xfcl1, /* 8,5 french canadian nrc to latin-9 */
  6643. xgel1, /* 8,6 german nrc to latin-9 */
  6644. xhul1, /* 8,7 hungarian nrc to latin-9 */
  6645. xitl1, /* 8,8 italian nrc to latin-9 */
  6646. xnol1, /* 8,9 norwegian/danish nrc to latin-9 */
  6647. xpol1, /* 8,10 portuguese nrc to latin-9 */
  6648. xspl1, /* 8,11 spanish nrc to latin-9 */
  6649. xswl1, /* 8,12 swedish nrc to latin-9 */
  6650. xchl1, /* 8,13 swiss nrc to latin-9 */
  6651. NULL, /* 8,14 latin-1 to latin-9 */
  6652. xl2l9, /* 8,15 latin-2 to latin-9 */
  6653. xdml9, /* 8,16 dec mcs to latin-9 */
  6654. xnel9, /* 8,17 NeXT To Latin-9 */
  6655. x43l1, /* 8,18 CP437 To Latin-9 */
  6656. x85l1, /* 8,19 CP850 To Latin-9 */
  6657. x52l1, /* 8,20 CP852 To Latin-9 */
  6658. xaql1, /* 8,21 Macintosh Latin To Latin-9 */
  6659. xdgl1, /* 8,22 DGI To Latin-9 */
  6660. xr8l1, /* 8,23 HP To Latin-9 */
  6661. xlcas, /* 8,24 Latin/Cyrillic To Latin-9 */
  6662. xacas, /* 8,25 CP866 To Latin-9 */
  6663. xskas, /* 8,26 Short KOI To Latin-9 */
  6664. xk8as, /* 8,27 Old KOI-8 Cyrillic To Latin-9 */
  6665. NULL, /* 8,28 Kanji ... */
  6666. NULL, /* 8,29 */
  6667. NULL, /* 8,30 */
  6668. NULL, /* 8,31 */
  6669. xh7as, /* 8,32 Hebrew-7 To Latin-9 */
  6670. xlhl1, /* 8,33 Latin/Hebrew To Latin-9 */
  6671. x62l1, /* 8,34 CP862 Hebrew To Latin-9 */
  6672. xegas, /* 8,35 ELOT 927 Greek To Latin-9 */
  6673. xlgl1, /* 8,36 Latin/Greek To Latin-9 */
  6674. xl169, /* 8,37 CP869 To Latin-9 */
  6675. NULL, /* 8,38 Latin-9 To Latin-9 */
  6676. x58l9, /* 8,39 cp858 To Latin-9 */
  6677. x55as, /* 8,40 cp855 To Latin-9 */
  6678. x55as, /* 8,41 cp1251 To Latin-9 */
  6679. xleft128, /* 8,42 Bulgarian To Latin-9 */
  6680. x1250l9, /* 8,43 CP1250 To Latin-9 */
  6681. xmzl9, /* 8,44 Mazovia To Latin-9 */
  6682. NULL, /* 8,45 UCS-2 to Latin-9 */
  6683. NULL, /* 8,46 UTF-8 to Latin-9 */
  6684. NULL, /* 8,47 KOI8R to Latin-9 */
  6685. NULL, /* 8,48 KOI8U to Latin-9 */
  6686. xw1l9, /* 8,49 CP1252 to Latin-9 */
  6687. NULL, /* 9,00 Unicode... */
  6688. NULL, /* 9,01 */
  6689. NULL, /* 9,02 */
  6690. NULL, /* 9,03 */
  6691. NULL, /* 9,04 */
  6692. NULL, /* 9,05 */
  6693. NULL, /* 9,06 */
  6694. NULL, /* 9,07 */
  6695. NULL, /* 9,08 */
  6696. NULL, /* 9,09 */
  6697. NULL, /* 9,10 */
  6698. NULL, /* 9,11 */
  6699. NULL, /* 9,12 */
  6700. NULL, /* 9,13 */
  6701. NULL, /* 9,14 */
  6702. NULL, /* 9,15 */
  6703. NULL, /* 9,16 */
  6704. NULL, /* 9,17 */
  6705. NULL, /* 9,18 */
  6706. NULL, /* 9,19 */
  6707. NULL, /* 9,20 */
  6708. NULL, /* 9,21 */
  6709. NULL, /* 9,22 */
  6710. NULL, /* 9,23 */
  6711. NULL, /* 9,24 */
  6712. NULL, /* 9,25 */
  6713. NULL, /* 9,26 */
  6714. NULL, /* 9,27 */
  6715. NULL, /* 9,28 */
  6716. NULL, /* 9,29 */
  6717. NULL, /* 9,30 */
  6718. NULL, /* 9,31 */
  6719. NULL, /* 9,32 */
  6720. NULL, /* 9,33 */
  6721. NULL, /* 9,34 */
  6722. NULL, /* 9,35 */
  6723. NULL, /* 9,36 */
  6724. NULL, /* 9,37 */
  6725. NULL, /* 9,38 */
  6726. NULL, /* 9,39 */
  6727. NULL, /* 9,40 */
  6728. NULL, /* 9,41 */
  6729. NULL, /* 9,42 */
  6730. NULL, /* 9,43 */
  6731. NULL, /* 9,44 */
  6732. NULL, /* 9,45 */
  6733. NULL, /* 9,46 */
  6734. NULL, /* 9,47 */
  6735. NULL, /* 9,48 */
  6736. NULL, /* 9,49 */
  6737. NULL, /* 10,00 */
  6738. NULL, /* 10,01 */
  6739. NULL, /* 10,02 */
  6740. NULL, /* 10,03 */
  6741. NULL, /* 10,04 */
  6742. NULL, /* 10,05 */
  6743. NULL, /* 10,06 */
  6744. NULL, /* 10,07 */
  6745. NULL, /* 10,08 */
  6746. NULL, /* 10,09 */
  6747. NULL, /* 10,10 */
  6748. NULL, /* 10,11 */
  6749. NULL, /* 10,12 */
  6750. NULL, /* 10,13 */
  6751. NULL, /* 10,14 */
  6752. NULL, /* 10,15 */
  6753. NULL, /* 10,16 */
  6754. NULL, /* 10,17 */
  6755. NULL, /* 10,18 */
  6756. NULL, /* 10,19 */
  6757. NULL, /* 10,20 */
  6758. NULL, /* 10,21 */
  6759. NULL, /* 10,22 */
  6760. NULL, /* 10,23 */
  6761. NULL, /* 10,24 */
  6762. NULL, /* 10,25 */
  6763. NULL, /* 10,26 */
  6764. NULL, /* 10,27 */
  6765. NULL, /* 10,28 */
  6766. NULL, /* 10,29 */
  6767. NULL, /* 10,30 */
  6768. NULL, /* 10,31 */
  6769. NULL, /* 10,32 */
  6770. NULL, /* 10,33 */
  6771. NULL, /* 10,34 */
  6772. NULL, /* 10,35 */
  6773. NULL, /* 10,36 */
  6774. NULL, /* 10,37 */
  6775. NULL, /* 10,38 */
  6776. NULL, /* 10,39 */
  6777. NULL, /* 10,40 */
  6778. NULL, /* 10,41 */
  6779. NULL, /* 10,42 */
  6780. NULL, /* 10,43 */
  6781. NULL, /* 10,44 */
  6782. NULL, /* 10,45 */
  6783. NULL, /* 10,46 */
  6784. NULL, /* 10,47 */
  6785. NULL, /* 10,48 */
  6786. NULL /* 10,49 */
  6787. };
  6788. int nxls = (sizeof(xls) / sizeof(CHAR *));
  6789. #ifndef NOLOCAL
  6790. /*
  6791. The following routines are useful only for terminal character sets, and so
  6792. ifdef'd out for NOLOCAL compilations.
  6793. */
  6794. /*
  6795. C S _ I S _ N R C
  6796. Returns nonzero if argument indicates a 7-bit national character set,
  6797. zero otherwise.
  6798. */
  6799. int
  6800. cs_is_nrc(x) int x; {
  6801. #ifdef UNICODE
  6802. if (x == TX_J201R || x == TX_DECSPEC || x == TX_DECTECH
  6803. || txrinfo[x] == NULL)
  6804. return(0);
  6805. else
  6806. return(txrinfo[x]->flags & X2U_STD && txrinfo[x]->size == 94);
  6807. #else /* UNICODE */
  6808. if ((cs_size(x) == 94))
  6809. return(1);
  6810. else
  6811. return(0);
  6812. #endif /* UNICODE */
  6813. }
  6814. /*
  6815. C S _ I S _ S T D
  6816. Returns nonzero if argument indicates an ISO 4873-standard-format
  6817. character set, i.e. one in which the control region is NOT used for
  6818. graphics; zero otherwise.
  6819. */
  6820. int
  6821. cs_is_std(x) int x; {
  6822. #ifdef UNICODE
  6823. if (!txrinfo[x]) /* Even more safety */
  6824. return(0);
  6825. else if (txrinfo[x]->size == 128) /* Just for safety */
  6826. return(0);
  6827. else
  6828. return(txrinfo[x]->flags & X2U_STD); /* Only this should be needed */
  6829. #else
  6830. switch (x) {
  6831. case FC_CP437: /* Code pages use C1 graphics */
  6832. case FC_CP850:
  6833. case FC_CP852:
  6834. case FC_CP862:
  6835. case FC_CP866:
  6836. case FC_CP869:
  6837. case FC_CP858:
  6838. case FC_APPQD: /* So do Apple and NeXTSTEP */
  6839. case FC_NEXT:
  6840. return(0);
  6841. default: /* Others behave */
  6842. return(1);
  6843. }
  6844. #endif /* CKOUINI */
  6845. }
  6846. int
  6847. cs_size(x) int x; {
  6848. #ifdef UNICODE
  6849. if (!txrinfo[x])
  6850. return(128);
  6851. return(txrinfo[x]->size);
  6852. #else
  6853. switch(x) {
  6854. case FC_USASCII:
  6855. case FC_UKASCII:
  6856. case FC_DUASCII:
  6857. case FC_FIASCII:
  6858. case FC_FRASCII:
  6859. case FC_FCASCII:
  6860. case FC_GEASCII:
  6861. case FC_HUASCII:
  6862. case FC_ITASCII:
  6863. case FC_NOASCII:
  6864. case FC_POASCII:
  6865. case FC_SPASCII:
  6866. case FC_SWASCII:
  6867. case FC_CHASCII:
  6868. case FC_KOI7:
  6869. case FC_HE7:
  6870. case FC_ELOT:
  6871. return(94);
  6872. case FC_1LATIN:
  6873. case FC_2LATIN:
  6874. case FC_DECMCS:
  6875. case FC_DGMCS:
  6876. case FC_HPR8:
  6877. case FC_CYRILL:
  6878. case FC_KOI8:
  6879. case FC_HEBREW:
  6880. case FC_GREEK:
  6881. case FC_9LATIN:
  6882. return(96);
  6883. case FC_NEXT:
  6884. case FC_CP437:
  6885. case FC_CP850:
  6886. case FC_CP852:
  6887. case FC_CP855:
  6888. case FC_CP862:
  6889. case FC_CP866:
  6890. case FC_CP1251:
  6891. case FC_APPQD:
  6892. return(128);
  6893. #ifdef KANJI
  6894. case FC_JIS7:
  6895. return(-94);
  6896. case FC_SHJIS:
  6897. return(-128);
  6898. case FC_JEUC:
  6899. case FC_JDEC:
  6900. return(-96);
  6901. #endif /* KANJI */
  6902. case FC_CP858:
  6903. default:
  6904. return(-1);
  6905. }
  6906. #endif /* UNICODE */
  6907. }
  6908. #endif /* NOLOCAL */
  6909. /*
  6910. S E T X L A T Y P E -- Set Translation Type
  6911. Sets global xlatype to indicate which kind of translation:
  6912. XLA_NONE No translation
  6913. XLA_BYTE Byte-for-Byte translation
  6914. XLA_JAPAN Japanese Kanji translation
  6915. XLA_UNICODE Unicode translations
  6916. And sets up the appropriate translation function pointers as follows:
  6917. For no translation:
  6918. All function pointers are NULL.
  6919. For Byte-for-Byte transation:
  6920. rx = TCS to FCS (these functions are in this module...)
  6921. sx = FCS to TCS
  6922. For Unicode translations:
  6923. xfu = FCS to UCS (these functions are in ckcuni.c...)
  6924. xtu = TCS to UCS
  6925. xuf = UCS to FCS
  6926. xut = UCS to TCS
  6927. */
  6928. VOID
  6929. setxlatype(tcs, fcs) int tcs, fcs; {
  6930. #ifdef UNICODE
  6931. xfu = NULL; /* Unicode <-> TCS/FCS functions */
  6932. xtu = NULL;
  6933. xuf = NULL;
  6934. xut = NULL;
  6935. #endif /* UNICODE */
  6936. rx = sx = NULL;
  6937. debug(F101,"setxlatype fcs","",fcs);
  6938. debug(F101,"setxlatype tcs","",tcs);
  6939. if (tcs < 0 || tcs > MAXTCSETS) {
  6940. debug(F101,"setxlatype bad tcs","",tcs);
  6941. return;
  6942. }
  6943. if (fcs < 0 || fcs > MAXFCSETS) {
  6944. debug(F101,"setxlatype bad fcs","",fcs);
  6945. return;
  6946. }
  6947. if (tcs == TC_TRANSP || xfrxla == 0) { /* Transfer charset TRANSPARENT */
  6948. debug(F101,"setxlatype transparent because TCS==Transparent","",tcs);
  6949. xlatype = XLA_NONE; /* Translation type is None */
  6950. #ifdef UNICODE
  6951. /* If any of our charsets is Unicode we use Unicode functions */
  6952. /* even if TCS and FCS are the same because of BOM and byte swapping */
  6953. } else if (tcs == TC_UCS2 || tcs == TC_UTF8 ||
  6954. fcs == FC_UCS2 || fcs == FC_UTF8) {
  6955. debug(F101,"setxlatype Unicode tcs","",tcs);
  6956. debug(F101,"setxlatype Unicode fcs","",fcs);
  6957. /* Unicode <-> TCS/FCS functions */
  6958. xfu = xl_fcu[fcs]; /* FCS -> UCS */
  6959. xtu = xl_tcu[tcs]; /* TCS -> UCS */
  6960. xuf = xl_ufc[fcs]; /* UCS -> FCS */
  6961. xut = xl_utc[tcs]; /* UCS -> TCS */
  6962. xlatype = XLA_UNICODE; /* Translation type is Unicode */
  6963. #ifdef COMMENT
  6964. /* These make trouble in 64-bit land */
  6965. debug(F001,"setxlatype Unicode xfu","",(unsigned)xfu);
  6966. debug(F001,"setxlatype Unicode xuf","",(unsigned)xuf);
  6967. #endif /* COMMENT */
  6968. #endif /* UNICODE */
  6969. } else if (cseqtab[tcs] == fcs) { /* Or if TCS == FCS */
  6970. debug(F101,"setxlatype transparent because TCS==FCS","",tcs);
  6971. xlatype = XLA_NONE; /* translation type is also None */
  6972. #ifdef KANJI
  6973. /* Otherwise if any of them is Japanese, we use Kanji functions */
  6974. } else if (tcs == TC_JEUC || fcsinfo[fcs].alphabet == AL_JAPAN) {
  6975. debug(F101,"setxlatype Japanese tcs","",tcs);
  6976. debug(F101,"setxlatype Japanese fcs","",fcs);
  6977. xlatype = XLA_JAPAN; /* Translation type is Japanese */
  6978. #endif /* KANJI */
  6979. /* Otherwise we use byte functions */
  6980. } else { /* Otherwise... */
  6981. rx = xlr[tcs][fcs]; /* Input translation function */
  6982. sx = xls[tcs][fcs]; /* Output translation function */
  6983. debug(F101,"setxlatype Byte tcs","",tcs);
  6984. debug(F101,"setxlatype Byte fcs","",fcs);
  6985. xlatype = XLA_BYTE; /* Translation type is Byte */
  6986. }
  6987. debug(F101,"setxlatype xlatype","",xlatype);
  6988. }
  6989. /* Set up translation between two file character sets with UCS intermediate */
  6990. #ifdef UNICODE
  6991. VOID
  6992. initxlate(csin, csout) int csin, csout; {
  6993. xfu = NULL;
  6994. xtu = NULL;
  6995. xuf = NULL;
  6996. xut = NULL;
  6997. debug(F101,"initxlate csin","",csin);
  6998. debug(F101,"initxlate csout","",csout);
  6999. if (csin < 0 || csin > MAXFCSETS) {
  7000. debug(F101,"initxlate bad csin","",csin);
  7001. return;
  7002. }
  7003. if (csout < 0 || csout > MAXFCSETS) {
  7004. debug(F101,"initxlate bad csout","",csout);
  7005. return;
  7006. }
  7007. if (csin == csout && csin != FC_UCS2) {
  7008. xlatype = XLA_NONE; /* Translation type is None */
  7009. return;
  7010. }
  7011. xlatype = XLA_UNICODE; /* Translation type is Unicode */
  7012. xfu = xl_fcu[csin]; /* FCS -> UCS */
  7013. xuf = xl_ufc[csout]; /* UCS -> FCS */
  7014. xpnbyte(-1,0,0,NULL); /* Reset UCS-2 */
  7015. #ifdef COMMENT
  7016. debug(F001,"initxlate Unicode xfu","",(unsigned)xfu);
  7017. debug(F001,"initxlate Unicode xuf","",(unsigned)xuf);
  7018. #endif /* COMMENT */
  7019. debug(F101,"initxlate xlatype","",xlatype);
  7020. }
  7021. #endif /* UNICODE */
  7022. int csetsinited = 0;
  7023. VOID
  7024. initcsets() { /* Routine to reset or initialize */
  7025. int i; /* character-set associations. */
  7026. #ifdef UNICODE
  7027. if (ucsorder < 0) /* For creating UCS-2 files. */
  7028. ucsorder = byteorder;
  7029. if (ucsorder < 0)
  7030. ucsorder = 0;
  7031. if (fileorder < 0) /* For reading UCS-2 files. */
  7032. fileorder = ucsorder;
  7033. #endif /* UNICODE */
  7034. debug(F101,"initcsets nxls","",nxls);
  7035. debug(F101,"initcsets nxlr","",nxlr);
  7036. debug(F101,"initcsets TERM LOCAL CSET","",tcsl);
  7037. debug(F101,"initcsets TERM REMOTE CSET","",tcsr);
  7038. for (i = 0; i <= MAXFCSETS; i++) /* First clear them all... */
  7039. afcset[i] = -1;
  7040. for (i = 0; i <= MAXTCSETS; i++)
  7041. axcset[i] = -1;
  7042. /* Now set specific defaults for incoming files */
  7043. xlatype = XLA_NONE;
  7044. axcset[TC_TRANSP] = FC_TRANSP;
  7045. axcset[TC_USASCII] = FC_USASCII;
  7046. #ifdef OS2
  7047. switch (fcharset) {
  7048. case FC_CP850:
  7049. case FC_CP858:
  7050. case FC_CP437:
  7051. case FC_1LATIN:
  7052. axcset[TC_1LATIN] = fcharset;
  7053. break;
  7054. default:
  7055. axcset[TC_1LATIN] = FC_CP850;
  7056. }
  7057. #else
  7058. #ifdef HPUX
  7059. axcset[TC_1LATIN] = FC_HPR8;
  7060. #else
  7061. #ifdef VMS
  7062. axcset[TC_1LATIN] = FC_DECMCS;
  7063. #else
  7064. #ifdef NEXT
  7065. axcset[TC_1LATIN] = FC_NEXT;
  7066. #else
  7067. #ifdef datageneral
  7068. axcset[TC_1LATIN] = FC_DGMCS;
  7069. #else
  7070. /* Should we use code pages on some PC based UNIXes? */
  7071. axcset[TC_1LATIN] = FC_1LATIN;
  7072. #endif /* datageneral */
  7073. #endif /* NEXT */
  7074. #endif /* VMS */
  7075. #endif /* HPUX */
  7076. #endif /* OS2 */
  7077. #ifdef OS2
  7078. axcset[TC_2LATIN] = FC_CP852;
  7079. axcset[TC_CYRILL] = FC_CP866;
  7080. axcset[TC_JEUC] = FC_SHJIS;
  7081. axcset[TC_HEBREW] = FC_CP862;
  7082. axcset[TC_GREEK] = FC_CP869;
  7083. axcset[TC_9LATIN] = FC_CP858;
  7084. axcset[TC_UCS2] = FC_UCS2;
  7085. axcset[TC_UTF8] = FC_UCS2;
  7086. #else
  7087. axcset[TC_2LATIN] = FC_2LATIN;
  7088. axcset[TC_CYRILL] = FC_CYRILL;
  7089. axcset[TC_JEUC] = FC_JEUC;
  7090. axcset[TC_HEBREW] = FC_HEBREW;
  7091. axcset[TC_GREEK] = FC_GREEK;
  7092. axcset[TC_9LATIN] = FC_9LATIN;
  7093. axcset[TC_UCS2] = FC_UTF8;
  7094. axcset[TC_UTF8] = FC_UTF8;
  7095. #endif /* OS2 */
  7096. /* And for outbound files */
  7097. afcset[FC_USASCII] = TC_USASCII;
  7098. afcset[FC_UKASCII] = TC_1LATIN;
  7099. afcset[FC_DUASCII] = TC_1LATIN;
  7100. afcset[FC_FIASCII] = TC_1LATIN;
  7101. afcset[FC_FRASCII] = TC_1LATIN;
  7102. afcset[FC_FCASCII] = TC_1LATIN;
  7103. afcset[FC_GEASCII] = TC_1LATIN;
  7104. afcset[FC_HUASCII] = TC_2LATIN;
  7105. afcset[FC_ITASCII] = TC_1LATIN;
  7106. afcset[FC_NOASCII] = TC_1LATIN;
  7107. afcset[FC_POASCII] = TC_1LATIN;
  7108. afcset[FC_SPASCII] = TC_1LATIN;
  7109. afcset[FC_SWASCII] = TC_1LATIN;
  7110. afcset[FC_CHASCII] = TC_1LATIN;
  7111. afcset[FC_1LATIN] = TC_1LATIN;
  7112. afcset[FC_2LATIN] = TC_2LATIN;
  7113. afcset[FC_DECMCS] = TC_1LATIN;
  7114. afcset[FC_NEXT] = TC_1LATIN;
  7115. afcset[FC_CP437] = TC_1LATIN;
  7116. afcset[FC_CP850] = TC_1LATIN;
  7117. afcset[FC_CP852] = TC_2LATIN;
  7118. afcset[FC_APPQD] = TC_1LATIN;
  7119. afcset[FC_DGMCS] = TC_1LATIN;
  7120. afcset[FC_HPR8] = TC_1LATIN;
  7121. afcset[FC_CYRILL] = TC_CYRILL;
  7122. afcset[FC_CP866] = TC_CYRILL;
  7123. afcset[FC_KOI7] = TC_CYRILL;
  7124. afcset[FC_KOI8] = TC_CYRILL;
  7125. afcset[FC_JIS7] = TC_JEUC;
  7126. afcset[FC_SHJIS] = TC_JEUC;
  7127. afcset[FC_JEUC] = TC_JEUC;
  7128. afcset[FC_JDEC] = TC_JEUC;
  7129. afcset[FC_HE7] = TC_HEBREW;
  7130. afcset[FC_HEBREW] = TC_HEBREW;
  7131. afcset[FC_CP862] = TC_HEBREW;
  7132. afcset[FC_ELOT] = TC_GREEK;
  7133. afcset[FC_GREEK] = TC_GREEK;
  7134. afcset[FC_CP869] = TC_GREEK;
  7135. afcset[FC_9LATIN] = TC_9LATIN;
  7136. afcset[FC_CP923] = TC_9LATIN;
  7137. afcset[FC_CP858] = TC_9LATIN;
  7138. afcset[FC_CP855] = TC_CYRILL;
  7139. afcset[FC_CP1251] = TC_CYRILL;
  7140. afcset[FC_BULGAR] = TC_CYRILL;
  7141. afcset[FC_CP1250] = TC_2LATIN;
  7142. afcset[FC_MAZOVIA] = TC_2LATIN;
  7143. afcset[FC_UCS2] = TC_UTF8;
  7144. afcset[FC_UTF8] = TC_UTF8;
  7145. afcset[FC_KOI8R] = TC_CYRILL;
  7146. afcset[FC_KOI8U] = TC_CYRILL;
  7147. afcset[FC_CP1252] = TC_1LATIN;
  7148. csetsinited++;
  7149. return;
  7150. }
  7151. #endif /* NOCSETS */