كشف تلقائي لصفحة الترميز
Contents
[
Hide
]كشف تلقائي لصفحة الترميز
تدعم Aspose.CAD الكشف التلقائي لصفحة الترميز لملفات DWG و DWF. إذا كنت لا ترغب في استخدام هذه الميزة، يمكنك تجاوز ذلك عن طريق ضبط الخصائص التالية من فئة LoadOptions.
- SpecifiedEncoding: يحدد الترميز المستخدم لقراءة بيانات النص من تنسيقات DXF و DWG غير Unicode. يتم اكتشافه تلقائيًا بشكل افتراضي.
- SpecifiedMifEncoding: يحدد الترميز المستخدم لقراءة الرموز المشفرة MIF لبرامج الترميز CJK (تنسيق M+nXXXX). يتم اكتشافه تلقائيًا بشكل افتراضي.
- RecoverMalformedCifMif: يحدد ما إذا كان سيتم فك تشفير أحرف CIF (U+XXXX) وأحرف MIF المشفرة إذا لم يكن لها تنسيق AutoCAD الصحيح (تسبق AutoCAD هذه الرموز بعلامة مائلة للخلف). بشكل افتراضي، يتم فك تشفيرها.
مثال على الكود
تظهر عينة الكود أدناه كيفية تجاوز الكشف التلقائي لصفحة الترميز في Aspose.CAD.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cad/Aspose.CAD-for-Java | |
String SourceDir = Utils.getDataDir_DWGDrawings(); | |
String dwgPathToFile = SourceDir + "SimpleEntites.dwg"; | |
LoadOptions opts = new LoadOptions(); | |
opts.setSpecifiedEncoding(CodePages.Japanese); | |
opts.setSpecifiedMifEncoding(MifCodePages.Japanese); | |
opts.setRecoverMalformedCifMif(false); | |
CadImage cadImage = (CadImage) Image.load(dwgPathToFile, opts); | |
//do export or something else with cadImage | |