What is the difference between utf-8 and utf-8-sig?

文章推薦指數: 80 %
投票人數:10人

"sig" in "utf-8-sig" is the abbreviation of "signature" (i.e. signature utf-8 file). Using utf-8-sig to read a file will treat the BOM as ... Home Public Questions Tags Users Companies Collectives ExploreCollectives Teams StackOverflowforTeams –Startcollaboratingandsharingorganizationalknowledge. CreateafreeTeam WhyTeams? Teams CreatefreeTeam Collectives™onStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. LearnmoreaboutCollectives Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. LearnmoreaboutTeams Whatisthedifferencebetweenutf-8andutf-8-sig? AskQuestion Asked 3years,2monthsago Modified 1monthago Viewed 37ktimes 40 IamtryingtoencodeBanglawordsinpythonusingpandasdataframe.Butasencodingtype,utf-8isnotworkingbututf-8-sigis.Iknowutf-8-sigiswithBOM(Byteordermark).Butwhyisthiscalledutf-8-sigandhowitworks? pythonpandasencoding Share Improvethisquestion Follow askedJul22,2019at20:00 JuBaerADJuBaerAD 54611goldbadge44silverbadges77bronzebadges 5 2 Ibelievethisisaduplicate:stackoverflow.com/questions/2223882/… – juanpa.arrivillaga Jul22,2019at20:08 2 WelcometoStackOverflow.ThissitemakesitclearthattheBOM(ByteOrderMark)isa"signature,"hencethe"sig"inthename.Thisquestionwithitsanswersexplainitsreasonsandhowitworks.HereisPythondocumentationonthetopic.Istheresomethinginparticularyoudonotunderstand? – RoryDaulton Jul22,2019at20:10 Possibleduplicateofpythonutf-8-sigBOMinthemiddleofthefilewhenappendingtotheend – RoryDaulton Jul22,2019at20:10 1 Idon'tfindanythingrelatedtothe'sig'part.That'swhyIaskedthisquestion. – JuBaerAD Jul25,2019at6:32 7 Thisisaperfectlyvalidquestion. – Nobilis Feb21,2020at10:43 Addacomment  |  1Answer 1 Sortedby: Resettodefault Highestscore(default) Trending(recentvotescountmore) Datemodified(newestfirst) Datecreated(oldestfirst) 43 "sig"in"utf-8-sig"istheabbreviationof"signature"(i.e.signatureutf-8file). Usingutf-8-sigtoreadafilewilltreattheBOMasmetadatathatexplainshowtointerpretthefile,insteadofaspartofthefilecontents. Share Improvethisanswer Follow editedAug29at12:55 LutzPrechelt 34k99goldbadges6060silverbadges8484bronzebadges answeredMar10,2020at9:10 eeeeee 44144silverbadges66bronzebadges Addacomment  |  YourAnswer ThanksforcontributingananswertoStackOverflow!Pleasebesuretoanswerthequestion.Providedetailsandshareyourresearch!Butavoid…Askingforhelp,clarification,orrespondingtootheranswers.Makingstatementsbasedonopinion;backthemupwithreferencesorpersonalexperience.Tolearnmore,seeourtipsonwritinggreatanswers. Draftsaved Draftdiscarded Signuporlogin SignupusingGoogle SignupusingFacebook SignupusingEmailandPassword Submit Postasaguest Name Email Required,butnevershown PostYourAnswer Discard Byclicking“PostYourAnswer”,youagreetoourtermsofservice,privacypolicyandcookiepolicy Nottheansweryou'relookingfor?Browseotherquestionstaggedpythonpandasencodingoraskyourownquestion. TheOverflowBlog HowtoearnamillionreputationonStackOverflow:beofservicetoothers Therightwaytojobhop(Ep.495) FeaturedonMeta BookmarkshaveevolvedintoSaves Inboximprovements:markingnotificationsasread/unread,andafiltered... Revieweroverboard!Orarequesttoimprovetheonboardingguidancefornew... CollectivesUpdate:RecognizedMembers,Articles,andGitLab Shouldweburninatethe[script]tag? Linked 974 What'sthedifferencebetweenUTF-8andUTF-8withBOM? 7 Howtoreadcsvfilefroms3bucketinAWSLambda? 8 pythonutf-8-sigBOMinthemiddleofthefilewhenappendingtotheend 1 Cleaning/decodingscrapedtextinbeautifulsoup Related 3130 Whatdoes**(doublestar/asterisk)and*(star/asterisk)doforparameters? 4405 Differencebetween@staticmethodand@classmethod 12289 Whatdoesthe"yield"keyworddo? 3113 WhatisthedifferencebetweenPython'slistmethodsappendandextend? 674 WhatisthedifferencebetweenUTF-8andUnicode? 3218 "LeastAstonishment"andtheMutableDefaultArgument 3475 Whatisthedifferencebetween__str__and__repr__? 1482 Whatarethedifferencesbetweentype()andisinstance()? 1263 Whatisthedifferencebetweennull=Trueandblank=TrueinDjango? 1819 Whatisthedifferencebetweenvenv,pyvenv,pyenv,virtualenv,virtualenvwrapper,pipenv,etc? HotNetworkQuestions 2016PutnamB6difficultsummationproblem Howtotellifmybikehasanaluminumframe Shouldselectedoptionsberemovedfromsingle-andmulti-selectdropdownlists? Howtoelegantlyimplementthisoneusefulobject-orientedfeatureinMathematica? Traditionally,andcurrently,whatstopshumanvotecountersfromalteringballotstomakethem'Spoilt/Invalidvotes? ShouldIusepwdortildeplus(~+)? What'sthedifferencebetween'Dynamic','Random',and'Procedural'generations? Could"nocloning"beusedasadefenceforquantumencryption? WhatistheAmericanequivalentof"Icalledmymomtoaskafterher"? MakeaCourtTranscriber Whydoesthesameelectrontransitionreleasephotonsofdifferentfrequenciesforsomeelements? Whoorwhatis"Nampat"inthechantoftheOrcsintheRingsofPower? Whydostringhashcodeschangeforeachexecutionin.NET? Whattranslation/versionoftheBiblewouldChaucerhaveread? PacifistethosblockingmyprogressinStellaris HowdoIdownloadmacOSMontereyonunsupportedMac? CommonPlotLegendsforDensityPlot DoestheDemocraticPartyofficiallysupportrepealingtheSecondAmendment? WhatdothecolorsindicateonthisKC135tankerboom? IfthedrowshadowbladeusesShadowSwordasarangedattack,doesitthrowasword(thatitthenhastoretrievebeforeusingitagain)? SomeoneofferedtaxdeductibledonationasapaymentmethodforsomethingIamselling.AmIgettingscammed? 9dotsthatare3by3,continuethepattern Myfavoriteanimalisa-singularandpluralform Theunusualphrasing"verb+the+comparativeadjective"intheLordoftheRingsnovels morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. lang-py Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?