Revision 23932
branches/v10/libraries/libDwg/src/com/iver/cit/jdwglib/dwg/DwgUtil.java | ||
---|---|---|
34 | 34 |
*/ |
35 | 35 |
package com.iver.cit.jdwglib.dwg; |
36 | 36 |
|
37 |
import java.io.UnsupportedEncodingException; |
|
37 | 38 |
import java.nio.ByteBuffer; |
38 | 39 |
import java.nio.ByteOrder; |
39 | 40 |
import java.util.ArrayList; |
... | ... | |
499 | 500 |
int bitLen = len * 8; |
500 | 501 |
Object cosa = DwgUtil.getBits(data, bitLen, bitPos); |
501 | 502 |
String string; |
503 |
//FIXME: Habr?a que ver de tomar el encoding correcto |
|
504 |
// a partir del Codepage que se encuentra en la cabecera |
|
505 |
// del archivo dwg, pero nos falta informaci?n |
|
506 |
// para relacionarlos. De momento tomamos "windows-1252". |
|
502 | 507 |
if (cosa instanceof byte[]) { |
503 |
string = new String((byte[]) cosa); |
|
508 |
try { |
|
509 |
string = new String((byte[]) cosa,"windows-1252"); |
|
510 |
} catch (UnsupportedEncodingException e) { |
|
511 |
string = new String((byte[]) cosa); |
|
512 |
} |
|
504 | 513 |
} else { |
505 |
// string = ((Integer)cosa).toString(); |
|
506 | 514 |
byte[] bytes = new byte[] { ((Integer) cosa).byteValue() }; |
507 |
string = new String((byte[]) bytes); |
|
515 |
try { |
|
516 |
string = new String((byte[]) bytes,"windows-1252"); |
|
517 |
} catch (UnsupportedEncodingException e1) { |
|
518 |
string = new String((byte[]) bytes); |
|
519 |
} |
|
508 | 520 |
} |
509 | 521 |
bitPos = bitPos + bitLen; |
510 | 522 |
ArrayList v = new ArrayList(); |
Also available in: Unified diff