asp.net - How to detect wrong encoding declaration? -


i building asp.net webservice loading other webpages , hand clients. have been doing quite character code treatment, reading meta tag html use codeset read file. nevertheless, less educated users don't understand code sets. declare specific encoding method e.g. "gb2312", in fact, using normal utf8. when use gb2312 decode text, turns out holy mess. how can detect whether text decoded? loaded page ie, correctly use utf-8 decode page. how achieve that?

based on bom can tell encoding used.

bom , encoding

bom , encoding

if want detect character set use c# port of mozilla's character set detector.

chardetsharp

if want make sure using correct one, maybe looking special characters not supposed there. not include "óké". looking such characters , try use different encoding/character set process file.

actually hard make application "fool-proof".


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -