自動コードページ検出
Contents
[
Hide
]自動コードページ検出
Aspose.CADは、DWGおよびDWFファイルの自動コードページ検出をサポートしています。この機能を使用しない場合は、LoadOptionsクラスの次のプロパティを設定することで上書きできます。
- SpecifiedEncoding:非Unicode DXFおよびDWG形式からテキストデータを読み取るために使用されるエンコーディングを設定します。デフォルトでは自動検出されます。
- SpecifiedMifEncoding:CJKエンコーディングのMIFエンコードシンボルを読み取るために使用されるエンコーディングを設定します(M+nXXXX形式)。デフォルトでは自動検出されます。
- RecoverMalformedCifMif:CIF(U+XXXX)およびMIFエンコードされた文字が適切なAutoCADフォーマットを持たない場合にデコードされるかどうかを定義します(AutoCADはこれらのシンボルの前にバックスラッシュを付けます)。デフォルトではデコードされます。
サンプルコード
以下のコードサンプルは、Aspose.CADで自動コードページ検出を上書きする方法を示しています。
This file contains hidden or 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 | |