Страница 1 из 1

Шрифты

Добавлено: 07 фев 2018, 10:10
smit72
Добрый день.
Проблема следующая. В Microstation v8i создается dxf (шрифт по умолчанию стоит кириллица 1251) со слоями на русском языке. В автокаде все открывается корректно (все слои читабельны). В QGIS (2.18.1) все наименования слоев как абракадабра (перепробовали при загрузке все способы кодировки).
Как решить проблему?
Спасибо.

Re: Шрифты

Добавлено: 07 фев 2018, 10:23
trir
исправить кодировку в загаловке dxf
Character Encodings
Normally DXF files are in the ANSI_1252 / Win1252 encoding. GDAL/OGR attempts to translate this to UTF-8 when reading and back into ANSI_1252 when writing. DXF files can also have a header field ($DWGCODEPAGE) indicating the encoding of the file. In GDAL 1.8.x and earlier this was ignored but from GDAL 1.9.0 and later an attempt is made to use this to recode other code pages to UTF-8. Whether this works will depend on the code page naming and whether GDAL/OGR is built against the iconv library for character recoding.

In some cases the $DWGCODEPAGE setting in a DXF file will be wrong, or unrecognised by OGR. It could be edited manually, or the DXF_ENCODING configuration variable can be used to override what id will be used by OGR in transcoding. The value of DXF_ENCODING should be an encoding name supported by CPLRecode() (i.e. an iconv name), not a DXF $DWGCODEPAGE name. Using a DXF_ENCODING name of "UTF-8" will avoid any attempt to recode the text as it is read.
http://www.gdal.org/drv_dxf.html
как абракадабра
какая именно?

Re: Шрифты

Добавлено: 07 фев 2018, 10:48
smit72
абракадабра всегда разная)))
я меняю вручную в dxf $DWGCODEPAGE на DXF_ENCODING, и значение ANSI_1251 на UTF-8.
В QGIS имена слои выглядят так: растительнсоть 1-4 м

Re: Шрифты

Добавлено: 07 фев 2018, 11:13
trir
$DWGCODEPAGE на DXF_ENCODING
не нужно, DXF_ENCODING это параметр GDAL и он имеет неправилное значение
растительнсоть 1-4 м
это как раз UTF-8 отображается как ANSI_1251

Re: Шрифты

Добавлено: 07 фев 2018, 11:41
smit72
Какие мои действия?