How do you batch convert UTF-16 to UTF-8? - PTC Community

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

So, I have attempted to create a Windows Command Line batch file to open Arbortext Editor and execute the command on the files in a local ... MENU Search LogIn cancel Turnonsuggestions Auto-suggesthelpsyouquicklynarrowdownyoursearchresultsbysuggestingpossiblematchesasyoutype. Showingresultsfor  Searchinsteadfor  Didyoumean:  AllcommunityThiscategoryThisboardKnowledgeUsers cancel Turnonsuggestions Auto-suggesthelpsyouquicklynarrowdownyoursearchresultsbysuggestingpossiblematchesasyoutype. Showingresultsfor  Searchinsteadfor  Didyoumean:  CloseX Community Arbortext Arbortext HowdoyoubatchconvertUTF-16toUTF-8? Options SubscribetoRSSFeed MarkTopicasNew MarkTopicasRead FloatthisTopicforCurrentUser Bookmark Subscribe Mute PrinterFriendlyPage HowdoyoubatchconvertUTF-16toUTF-8? Green12 3-Visitor ‎Nov29,2018 09:24AM MarkasNew Bookmark Subscribe Mute SubscribetoRSSFeed Permalink Print EmailtoaFriend NotifyModerator ‎Nov29,2018 09:24AM HowdoyoubatchconvertUTF-16toUTF-8? Hi,IhavealotoffilesthatIhaveexportedfromtheAADCSDBandIwanttoconverttheminbulkfromUTF-16toUTF-8.IamfamiliarwiththefollowingACL: save_as-encodingutf-8myfilename.xmlThisworksbutistoolaborioustorepeatforeveryfile.So,IhaveattemptedtocreateaWindowsCommandLinebatchfiletoopenArbortextEditorandexecutethecommandonthefilesinalocaldirectoryusingthe-cswitch.AtthemomentIgetnothingoutofit.Thescriptdoesnotopenadialogandasktosavethefile.Iwouldprefertomerelyreplacethecurrentfile.Doesanyonehaveasuggestionastohowthescriptmightbeimprovedinordertoprocessmultiplefiles? :REMconvertallfilesindirectoryfromUTF-16toUTF-8 ECHO********************* ECHOCONVERTUTF16TOUTF8 ECHO********************* for%%fin(*.xml)do("C:\ProgramFiles(x86)\PTC\ArbortextEditor\bin\x86\editor.exe"-c"save_as-encodingutf-8"%%f) ECHO********************* ECHODONE ECHO********************* Labels: Labels: Aerospace&Defense 0 Kudos Reply NotifyModerator Allforumtopics PreviousTopic NextTopic 2REPLIES2 GarethOakes 15-Moonstone (To:Green12) ‎Nov29,2018 04:19PM MarkasNew Bookmark Subscribe Mute SubscribetoRSSFeed Permalink Print EmailtoaFriend NotifyModerator ‎Nov29,2018 04:19PM StartwithasimplerbatchfilethatjustprintsouttheXMLnamesonscreenthenbuilditupfromthere.Yoursyntaxlooksprettyclosetocorrectsothereisprobablynotmuchwrong.OnethingIwoulddoisdouble-quotethefinal%%fvariableasWindowscommandlinewon'tprocessfilescontainingspacesotherwise. 0 Kudos Reply NotifyModerator Green12 3-Visitor (To:GarethOakes) ‎Dec03,2018 08:14AM MarkasNew Bookmark Subscribe Mute SubscribetoRSSFeed Permalink Print EmailtoaFriend NotifyModerator ‎Dec03,2018 08:14AM Thankyoufortakingthetimetoreply.I'llrewritethis.By thewayAdobeCS4DreamweaverwillalsosavefilestoUTF-8. OpenthefilewithDreamweaver,fromthemenuselect:Modify/PageProperties,fromthedialogboxselectDocumentEncoding:usingthedropdownmenuchooseUnicode(UTF-8), ClickOK FromthemenuchooseFile/Save. Closethefile.   UTF-8usuallycutsthefilesizeinhalf,approximately.Ihavenoideahowreliablethisis.   0 Kudos Reply NotifyModerator PostReply Announcements About PTC.com Products&Solutions Contact Resources MyPTC-Support PTCUniversity HelpCenter-ProductGuides ProductDocumentation SuccessPaths-Planning&ImplementationGuides OtherPTCCommunities OnShape RealityLab VuforiaEngine PTCuser TermsofService LegalPolicies facebook twitter linkedin youtube



請為這篇文章評分?