Asp. NET to implement Chinese simple/traditional automatic conversion of class _ Practical skills

Source: Internet
Author: User
Tags chop flush httpcontext ming

In the Chinese website development, in order to meet the Taiwan/Hong Kong and other Chinese traditional reading habits of users, many sites need to implement the Chinese Simplified/traditional conversion.

Of course in the actual development, but also pay attention to the site's picture if there is Chinese, also need to be based on the current display is simplified, or traditional to switch, otherwise can not achieve the effect! In this article, I only post the code for Chinese character conversion. If there is no clear how to call, please leave the email under my blog. I send you the calling code example directly!

Note: If in the practical application, found that there is this example font of Chinese characters, can add their own, traditional simplified corresponding words in the _SGB and _TGB in the corresponding position to be consistent! Otherwise the conversion will be a problem!

code example:


<summary>
Summary description of the g2b5filter.
Convert GB2312 characters and Big5 characters to a controlled conversion
Author: Program Hunter 2003-06-24
</summary>
public class G2b5filter:stream
{
Private Stream _sink;
Private long _position;

Private Const string _sgb=@ " Ai io Hinder love ao dam strike to do trip help tied pound slander to peel full bao, abalone Jackal prepare exhausted stretch pen The coin closes the margin to change the argument braid the standard turtle to be not to be deflated the bin to be in the bank and the bowl platinum to make up the money to participate The Silkworm poor Cang Cang bin Cang astonished side book layer mixed with Cicada Chan greedy slander shovel production of a long time to pay the bowel factory Chang-chong-Chen lining to support the punishment Cheng Che-chi, the shame of the teeth in the 踌 The touch of the sore to enter the hammer pure words to give Cong chimneys from the bundle of the wrong to jump up and take credit Tan Shan mend Christmas bomb when the party stalls the island and pray for the light to steal the lamp, Deng Enemy, the transfer of electricity, the Dian Diao, and the top ingot of the set. The East moves the frozen bucket calf to read the gambling, the satin team to the ton blunt the goose amount to be bad hungry er to send the punishment valve to be the same as the same time, the rice--------------------------诽 Feng Skin radiance and Fu Fu re negative obituary fu tie the calcium Gaigan to cast the stalk Gan gang gang just put the Pigeon Pavilion Chrome to Shing tribute hook Ditch construction purchase enough cruel gu Hung Guan Museum used to pass the broad regulation of the GUI GUI executioner roll roll pan Guo Hanhan there crane he Wang hung after a pot of Hu Hu-hua painting of the family of the bad Huan Huan and the ring also slow to call 痪 Huan Huan yellow lie wave to kill bribe dirty will be braised in the sauce of the meat and dust, and the goods to hit the machine is a hunger mark Chicken Performance---------------------------------------------checking alkali and base, picking up Jiang and reducing recommendation threshold to practice cheap see key ship sword money gradually splash the pulp Jiang Oar award speak sauce glue pouring arrogance jiao stir hinge straightening richest foot dumplings pay the lower section Jie Jie commandments the tight Jin only to Jin Ember all the strength Jing-stem whales surprised by the neck-static mirror-diameter spasm of the old colt lifted by sawing fear of the play Cuckoo Juan Silk awareness of the June June Kai Shell class Ken-ku-ku-executioner-block------------------------------Kui---厉励砾 calendar Li Lian Lian, sickle-pity ripple curtain convergence face chain love refining and food cooling two of the treatment of Liao-Lin lease age bell Linglingling collar distillation Liu Long deaf throat Cage Ridge Long Long Lou Lou put the basket Lu Lu skull lu Lou Furnace "
+ "Captivity of Ruthero Lu-LU aluminum companion repeatedly worry about the filter green Luan Twin Luan Disorderly whirl Lun Lun, the Luo luo logos gong luo ma horse code horses scold?" buy mai sell mai hide eels pretty full 谩 cat anchor riveting trade? Mildew no magnesium door stuffy the mystery of manganese dream find Power cotton Burma temple out of the Min Ming and Ming absurd seek mu na na difficult to tickle the brain annoyed and tired of the stuffed birds Nie nickel lemon hunting ning twist muddy button new pus, strong agricultural malaria Connaught Ouchi fight vomit retting dish Pang compensation jet Peng cheat drift frequency Poor apple by the spread of the spectrum of habitat melancholy umbilical qi ride not to open the gas to abandon pull the lead to move to sign the hand of the Qian Tong Qian Qian pliers submarine shallow cut gun choke wall Qiang strong Rob Spade bridge Chowa Qiao Body, light hydrogen dumping, please celebrate on the right of body-driving caries in the area of Qiong-poverty in the district of Jean but the Magpie really let Rao around hot-thread rong velvet soft sharp run sprinkle the gills of three umbrella mourning sweep wipe screen drying support, and the damage of the fire to burn Shaoxing credit to be the judge of the kidney infiltration The sound rope wins the Holy Master Lion wet poem Corpse time eclipse to be true to be in the book redeem the tree vertical count handsome double who the tax shun Shuo impressive Su although with sui old sun damage bamboo shoots shrink Lock Rex tart A discussion on the tan Tan of the state amortization of greed paralysis soup hot tao sash Please make a copy of SB title Drawer Stick Iron Hall hearing hydrocarbon copper head bald figure Coating Regiment decay shed tuo tuo camel-Bend Bay stubborn million net Wei Wei Wei pseudo Wei Wei Warm smell of grain stability asked urn I scroll vortex nest----------------------------------------------------------wu pin Xiao Zhao Scorpion with the threat of harmonic write Xie Xie Zinc Peacemaker hing because they rust embroidery Xu Xuan Xussu thread to continue to choose to suspend the election tinea gorgeous learn to find training hearing the weak pressure Raven duck Dumb Asia surprised and strict Yan Yan tired, Yan Yan proverb test 鸯 Yang Yang Itching to keep the kind Yao Yao Yao remote kiln ballad medicine Master leaf Industry leaves medical and Iridium yi instrument ant art yi yi the yin and the silver drink hidden Sakura Baby Eagle Ching Fluorescent Camp Fluorescent flies win Ying-fu Carbuncle Dance yong The lure of fish and fishery entertainment and Yu language calls the Imperial prison reputation of the yuan shafts Park members are far willing to the key Yue Yue Yue to read cloud Yunyang evenly Yun Yun Christie Halo Yun, a collection of miscellaneous disaster collection temporarily praise dirty chop jujube blame the choice ze thief gift tie "
+ "The Rolling cutter gate cheats the debt felt the mat to chop the roll to open up the stack battle to bloom the account expansion Zhao the GE this zhen needle to investigate and diagnose the town to be opened 狰 to compete the frame Zheng Zhi to hold the paper to throw the quality to hold the bell to end the type to raise all the Zhun of the candle, casting and building in the special brick to make up the pile Zhuang makeup strong-shaped cone pendant with the turbidity of the total longitudinal 邹诅 Group Drill 芈 Sik She 厣 nightmare pseudo 匦 Gui Shen manipulate 刿 Kelly slouching 伥 shabby queue couple Yan Li Minamata 偾 偬 hunchback 傥 Champagne nuo 佥 buy school 冁 Fu Yan diced 讦 讧 the 讴 ju the 诋 the Dingyi con lei 诖 诙 shenshen Quan Inquiry sunfaith buffoonery Lively 诮 The exaggeration Suwa 诼 shifted flattery and recite Boaster mo voluntarily 谡 a 谫 electrocute qiao Lumpy, 谳 卺, 陧, 邝邬邺 Jia Kuai 郓 Li, and the loessial, the Kaew, the, 埘, and Guo The Xun, the, and the Yingying 蒇 蒉 Lou mo Hedges 蓣 Cayratia 蔺蕲薮 Moss Lian embarrassed palpable tuan Cambridge slap whipped Press 摅 撄 and 撺 beep--------click Creak Xiao, 哕--哙 someone----哝 Suona to Lu Kuch costing bridle Boingo Jiao Zheng Lao Lai Person Summit of 犷 狯 狲 猃 猡 猕 táng chaos 饩 cooking filled onto rates Yi 饽 The 馄 famine cuisine the Wu 赓 Lin repentance the habits gastro retort 忾 to be in the Langfeng threshold Changxu Learn am 阏 阒 tie down 阙阚沣 Wei Lok Jia Zhen yingde kuai lai 渑 Shenyang lu liling 溆 yan ya She 滢, Ying and Lian Zhu Qian the 逦 of the ao sandals zang 驷 Consort Zou Crossbow aweary xiao Hua and 骒 骓 骖 stallion wu AO Liu gelding Puma Cong 骣 Longchamp zhou 纥 纨 texture pi size reins crepe 绂 and 绋 绠 burnt-out and ti can go fusiform 缌 缏 缑 lowered path-缜 mantra-缡 constricted 缣 Plantronics ectoplasms and pitch Miu Yi-enjoyed-Zeng loving felling 缳 缵-珏-Xu-hun-Lian--ai-ying-stable Zan casket 椠 Luo coffin Lam 榇 Palmetto Beech Penang Qiang enshrined oars Purlin dead War Meteor The funeral of the Shevchenko 轳 Zhi Chang squeaked 轺 轼 轾 辁 The LU and the roll y happy the resounds to 戋 "
+ "Wealth gai 赆 Relief lai 赇 danfo 赙 觇 Exploit wizard 觌 involved Gou kun qu 毵 氇 argon the slips of Shin Kuai 脶 pickled 腽 patellar 欤 Squall sa jdk hub 齑 lan Yang wei stew ye braised 焘 you zhen Zen frontline min Melancholy stupid the 泶 rocky Wangshitang tridacna kip Qiaoqi, walks niche, was walking my, gadolinium, Chiu, ruthenium, Kushiro, samarium, neodymium, titanium, mendelevium scandium francium holmium Palladium'll cobalt coltan cymbals Zheng Molybdenum tantalum Tomahawk dian CE-tl bismuth niobium-beryllium-handcuff rhodium-europium Mingshuo Cheng Forcipomyia clang indium-Alloy Hua Quan hafnium undercover 铫 铮 cesium 铴 ammonium rubidium lawrencium rhenium terbium keng Lithium zirconium osmium file 锊 end up bending their heads 锖 adze Kua 锟 occluded 锩 锬 zi Shan wedge kailian strontium 锷 Its utensils sou fines router clang hi cadmium engraving lutetium yi Gallium wrought dart boring trowel screwdriver woonyoungia arrowheads turnings dysprosium tan protactinium upsetting lanthanum praseodymium offerings stirrup bracelet Ytterbium Chung 穑 bustard Poison COO Thrush Cormorant Robin Strigidae Lucille Emu Prey 鸹 鸺 luan bo 鹆 swinhoe Ukai,, Kakapo, 鹌, Bulbul, 鹕,, 鹣, the, and Partridge 裣 Tuck Rags 襁 皲 columbine 聍 聩 mandatory qi 颃 Jie jaw chin jaw zhuan temporal 颟 sang Hao pin qiu 虮 虿 clam oyster clams 蛲 cockles 蛴 蝈 salamanders being caged counter poppy Benedict 笾 honouring Zheng ze suitcase sheath sisters Xiao 篑 Duan 舣 hygiene Niao hydroxy grits 絷 bran 趱 Yan 酾 鹾, stumbled, 跞, 跸 undercover Seizo stumble 踯 nie 蹒 蹰 躏 bounced goblets 觯 Gimli 龀 龃 龆 The bared,, 龉 龊 龌, June Strider-Luan, squid, pelochely bibroni bass 鼍 collation limulus mackerel Wahoo Tuna oolitic jesus mackerel 鲋 acipenser 鲒 silver carp Booby, Ectenes Shark carp crucian carp mackerel Rendahli minnows herring kun brachypomum pinchonii catfish seabream mullet 鳆 huso ao fin sole widowed ray 鳓 swimbladder cod eel siniperca eel trout snakehead dal 鞯 Uighur crossbones hip patellar smile Pixy 黩;

Private Const string _tgb=@ " 皚 藹 襖 Olympic dams strike to issue to help bind the pound 絆 謗 the stripped lifetime Bob 鋇 and 狽 shot awareness change debate 辮 Mark 鱉 癟 Endangered riverwalk, 擯 flick cake, and it is to be turned over for the 缽, platinum connected carrot sad brightening flies hatch Barn 滄 toilet on the side of 詫 攙 the 摻 cicadas 饞 讒 Dogfight spade production makes trembling field to be in the same-------------------------money Touches the piles broke creative cylinders pure Dolcevita resignation word to be smart onion chimney from the bush compact 躥 fault 竄 鄲 the 搗 Island prays for the pirate Light Tang enemy 滌 to the 締 upside point cushion the fishing to adjust the Crown mole fold throwing things building 犢 gambling plated forgings ribbons confirmed troops tons dull capture abortion punishment goose the 訛 bait 貳 the valve of the trouble 琺 visit 礬 Fly 釩 waste trafficking Lyon exciting 誹 colorful the wind crazy graves sewing dung--- Phoenix skin radiation were 訃 the bondage tetrahydrate 稈, 贛 the entire Car of the town of the same, and have the same Longgang, and Hao stranded pigeons the palace 鞏 contribution claws is 蠱 to look after 剮 's museum habits consistent wide silicon turtle 閨 orbit tricks Deli Precious 劊 輥 pan, hackers, 閡 鶴 Hubbard and Huan to protect pot 滬, and also to slow down the rushing paralyzed the Longoza to destroy 渙 bribery 穢 燴 conceal to capture the 誨 and 葷 to attack the 渾, accident. Chicken grades Warrant, 薊, and the pods cheeks Steve potassium The destroyers, and the tough 箋 緘 check berberine alkaline chosen pick simple 儉 recommended threshold draw the practices cheap see the key battleship Saber 餞 gradually splash 澗 will plasma 蔣 Award sauce propeller proud Delicate stirring 鉸 矯 僥 leg 餃 Paying the 絞 of vehicles commandments only She into Antony cautious to Shan the Ashes the Juice of the campaign negundo the Trail Penis campaign neck 痙 old Tangled the 廄 the 駒 to be saw and the Huan Shell class settlements Chickens copied library pant boast snobbish wide mines 曠 situation thanks 巋 Glimpse feedback Breakdown extension wide wax the intercept basketball 闌 瀾 讕 the 攬 lazy and cables labor abused and 撈 the tears 澇 away softball grit calendars asphalt and scythe poor ripples curtain 斂 facial link Alchemy The food of the two to forgive 遼 鐐 to the neighbor scales 凜 賃 of the Ling Fanling distillation Chris Lau to deaf throat cage monopolistic 攏 隴 Lou 摟 "
+ "擄 鹵 Captive, bribe Paul Donkey Lu aluminum Couples floundering hamamelis to consider the green 巒 攣 孿 灤 Chaos stall The Rurunrun is the prime Gong 籮 騾 camel the 螞蟻 scoid? Buy a hiding 饅 to sell for Michael Mold does not magnesium door boring oleate dream mystery the Messiah 覓 冪 sponge Myanmar Shrine Mercy 閩 Resonance motto absurd conspiracy acre sodium harass the 餒 the 膩 to 攆 the linen the stuffed the 聶 to rodents 鑷 a 鎳 of the birds lemonade to be in the New York, 獰 ning the screwed of the New Zealand 濘 膿 Bond cast Trampun reparations jet thin Songkran Aleppo Poker cobblestone Pot recipe habitat 淒 Belly and wouldn't and 訖 lead 扡 The humility money bleeder shallow condemnation graben gun 嗆 wall 薔 strong Rob 鍬 bridge Joe 僑 dead tricks theft Chin dear bedroom light Hydrogen propensity 頃 please the torso of the 齲 zygomatic rights advise in the vigénère of the poor region Choquette make spare to disturb the sewing honor fuzzy the soft sharp rinjita sprinkled the gills umbrella harassment Shibuya yarn kill filter to the 曬 to be the 陝 to be hurt by the 贍. The voice of the Okinawan, the Lion of the Holy Master, erosion the knowledge of the longevity of the hubs of salvation handsome both who tax the welcome flashing 飼 towering 慫 celebrate courts recite the Soviet tell 擻 although serious years 綏 to lock grandchildren 筍 撻 stalls greedy paralyzed beach altar Tantra talk Marvel soup hot Wentao 絛 Burn the 謄 the subject 銻 the media listen to drawer bronze head 烴 the Bald 頹 transformation Ostrich 馱 Camel Elliptical orbits 窪 Bend Bay sock The internet is in friend 濰 great hypocrisy 葦 Wen Wen jar 撾 蝸 swirl hive A oooo tungsten Uruguayan pollution 誣 no 蕪 Wu Hollywood mission fog the game wide 轄 Strait Batman narrow building 謙賢 title did nothing the filling envy the constitution compartment the county 鑲 Depression Marketing tsunami Die gimp threats harmony write 瀉 Thank Firebrake provocative happy 洶 Rusty embroidery false 噓 Syria Lingxuan training 癬 絢, hoon, untamed the of Jefferson and to the opium of salt and duck and the color and the dumb Itch 瑤 Rock Yau remote 窯 She Medicine page 銥 頤 The ants of the 詣 繹 the shade the cherry of Baby eagle to 纓 Crystal 熒 to win flies stand to have yo maid to have a roll-and-do-to-have-to-have-have-to-have-to-have-a-the-the 輿 fish fishing entertainment and the island are calling for the harness 鴛 depths 轅 Park members of the circle to be keys chow the Cantonese of 鄖 the evenly the, the crater, 蘊 醞 the dizzy of the, and the rhythmic of the dirty 攢, the 贓 鑿 "
+ "劄 gin 鍘 閘 bars Scams fasting debt 氈 盞 cutting 輾 brand Hoteis War bloomed Zhang increases account accounts hyperinflation 趙 蟄 轍 鍺 This Joan Needle Scout diagnostics Struggle open My 猙 frame Cheng certified sincere dropped flag mass 滯 minutes swelling and the pig. 誅 Candles 矚 Testament Storage Cast is a professional stationed, brick stake-a-strong cone-a 贅-綴, 諄-A-for-you-濁-漬-Complex-鄒-curse-mutual benefit-羋-xianse-厙-厴------the--------靨 僨傯僂儻儐儺僉糴黌囅鳧兗袞褻臠稟塚訐訌訕謳詎訥詁訶詆詔詒誆誄詿詰詼詵詬詮諍諢詡誚誥誑誒諏諑諉諛諗諂誶諶諫謔謁諤諭諼諳諦諮諞謨讜謖諡謐謫譾譖譙譎讞譫讖巹陘隉鄺鄔鄴郟鄶鄆酈芻奐勱巰堊壙壢壚埡塏塒堝塤薌藶莧萇蓯苧蘢蔦塋煢蕘蓽蕎薈薺犖滎藎蓀葒蒔萵蒞蕕 鶯縈蕆蕢蔞驀蘺蕷蘞藺蘄藪蘚奩尷捫摶撟摑摜撳攄攖擷擼攛嘰嘸囈嚦唄嚀噠嘵嗶噦噲嚌噥嘜嘮嗩嘖囀嘍嚳囁噯轡嚶嚕圇幃幬幘幗嶇峴嵐嶧嶠崢嶗崍嶸崳嶁巔徠獷獪猻獫玀獼餳飩餼飪飫飭飴餉餑餘餛餿饃饈饉饌廡賡廩懺憮慪愾悵愴懌慟懨惻愷惲慳愜慍憒懍閂閆闈閎閔閌闥閭閫鬮 閬閾閶閿閽閼闃闋闔闐闕闞灃溈瀧瀘濼涇浹湞澮瀏滸潯淶潿瀆澠瀋淥漵灩灄瀅潷瀠瀟瀲瀦瀨灝騫邇逕邐屨弳嫵嫗媯姍婭嬈孌媧嫻嬋媼嬡嬪嬙嬤駔駟駙騶驛駑駘驍驊駢驪騏騍騅驂騭騖驁騮騸驃驄驏驥驤紆紂紇紈纊紜紕紓紺絏紱縐紼絀絎絳綆綃綈綾綺緋緄綞綬綹綣綰緇緙緗緹緲繢 緦緶緱縋緡縉縝縟縞縭縊縑繽縹縵縲繆繅纈繚繒繾繰繯纘璣瑋玨瓏頊璽琿璉璦瓔璿瓚韙韞韜榪櫪棖樅梟櫛櫳櫨梔櫟檉椏橈楨榿樺檜欒欞櫝槧欏槨欖櫬櫚櫸檳櫧檣櫫櫓櫞簷檁歿殤殞殮殫殯軔軛軻轤軹軼軫轢軺軾輊輇輅輒輦輞輟輜輳轆轔戔戧戩甌曇曄暉曖賁貰貺貽贄 "
+ ' 貲 賅 贐 賑 賚 賕 賧 賻 覘 覬 覡 覿 覦 覯 Hajj 覷 毿 氌 氬 氳 牘 朧 臚 Shin 膾 腡 marinade 膃 臏 歟 颮 颯 Hurricane 颼 driving 轂 齏 斕 煬 煒 cocido sunson braised 燾 禰 禎 Zen 懟 愨 San 懣 戇 Chow 澩 碭 硨 礪 礱 硤 磽 Chan 磣 龕 graces 瞼 di she 羆 bohemian 釓 yttrium polonium 釗 釕 thorium 釧 釤 mendelevium 釵 釹 titanium 鈑 鈐 francium scandium 鈄 transmission palladium 鈺 鉦 Cobalt 鈳 plutonium Jinbo 鉞 to tetrachloride oxide 鉭 鈿 鑠 tetrahydrate 鉉 鏵銓鉿鎩銚錚銫銃鐋銨銣鐒錸鋱鏗鋰鋯鋨銼鋝鋃鋟鋦錒錆錛錁錕錮錈錟錙鍥鍇鍶鍔鍤鎪鍰鏤鏘鏌鎘鐫鎦鎰鎵鑌鏢鏜鏝鏍鏞鏃鏇鏑鐔鏷鐓鑭鐠鏹鐙鑊鐲鐿鑣鍾穡鳩鳶鴇鴆鴣鶇鸕鴝鴟鷥鴯鷙鴰鵂鸞鵓鸝鵠鵒鷳鵜鵡鵪鵯鶉鶘鶚鷂鶼鸚鷓鷚鷯鷦鷲鷸鷺鸛癤癘癆癇癉瘞癭癮癩癲竇窶襠褳 襝襇褸襤繈皸耬聹聵頇頎頏頡頜頦頷顎顓顳顢顙顥顰虯蟣蠆蜆蠔蠣蟶蛺蟯螄蠐蟈蠑螻罌篤筧籩篳箏簀篋籜簞簫簣籪籟艤艫嫋羥糝縶麩趲釅釃鹺躉蹌蹠躒蹺蹕躚躋躓躑躡蹣躕躪躦觴觶靚靂霽靄齔齟齙齠齜齦齬齪齷黽黿鼉雋讎鑾鏨魷魴鮁鱸穌鮒鱟鮐鮚鮪鮞鱭鮫鯗鱘鯁鱺鰱鰹鰣鰷鯀 鯊鯇鯽鯖鯪鯫鯡鯤鯧鯢鯰鯛鯔鰈鱷鰍鰒鰉鼇鰭鰨鰥鰩鰳鰾鱈鰻鱖鱔鱒鱧韃韉鶻髏髖髕魘魎饗饜鬢黷黲鼴";

Public G2b5filter (Stream sink)
{
System.web.httpcontext.current.response.contentencoding=encoding.getencoding (950);
_sink = sink;

}

The following members of the Stream must are overriden.
public override bool CanRead
{
get {return true;}
}

public override bool CanSeek
{
get {return true;}
}

public override bool CanWrite
{
get {return true;}
}

public override Long Length
{
get {return 0;}
}

public override Long Position
{
get {return _position;}
set {_position = value;}
}

public override long (long offset, System.IO.SeekOrigin direction)
{
Return _sink. Seek (offset, direction);
}

public override void SetLength (long length)
{
_sink. SetLength (length);
}

public override void Close ()
{
_sink. Close ();
}

public override void Flush ()
{
_sink. Flush ();
}

  public override int Read (byte[] buffer, int offset, int count)
  {
   return _sink. Read (buffer, offset, count);
 }

 ///<summary>
 ///jobs that actually handle character substitutions, replacing simplified and traditional characters.
 ///</summary>
 ///<param name= "buffer" > </param>
 ///<param name= " Offset "></param>
 ///<param name=" Count "></PARAM>
  public override void Write (byte[] buffer, int offset, int count)
  {
   Encoding e=encoding.getencoding (936); //936 is GB2312 encoded, 950 is BIG5 encoded

String str=e.getstring (Buffer,offset,count);

for (int i=0;i<str. length;i++)
{
int J=_sgb.indexof (str[i]);
if (j!=-1) str=str. Replace (_sgb[j],_tgb[j]);
}
E=encoding.getencoding (System.Web.HttpContext.Current.Response.Charset);
_sink. Write (E.getbytes (str), 0, E.getbytecount (str));

}

}

public class Encodingfilter
{
Page Thispage;

Public Encodingfilter (Page mpage)
{
Thispage=mpage;
}

<summary>
Encodes the stream object that is entered, and then write
</summary>
<param name= "Encodingstyle" ></param>
public void g2bencoding (string encodingstyle)
{
======================== Public Function Start =============================
Thispage.response.contentencoding=encoding.getencoding ("GB2312");

if (encodingstyle== "BIG5")
{
ThisPage.Response.Filter = new G2b5filter (thisPage.Response.Filter);
Thispage.response.charset= "BIG5";
}

if (encodingstyle== "GB2312")
{
Thispage.response.charset= "GB2312";
}

======================== Public Function End =============================
}

}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.