Korean text shows ??? in a DWG — ZWCAD, BricsCAD, Mac/Linux: font vs. encoding fixes

LeDeuxions · 한국어

You open a drawing from a Korean office. Dimensions and English notes look fine, but every room name, legend and note in Korean is a row of question marks.

Most advice says "install the font." Often that's right. But sometimes every font is installed and the ??? stays. In that case the problem isn't the font at all — it's the encoding. Different cause, different fix.

The 30-second test

In the broken drawing, type a new piece of Korean text (TEXT command, e.g. "가나다").

The classic case: drawings saved in ZWCAD (or AutoCAD) on a Korean Windows PC, then opened in BricsCAD or on a Mac or Linux machine. They look perfect back at the office, which makes it confusing.

Cause A — encoding in older drawing formats

DWG and DXF store text differently depending on the format version. Before R2007 (AC1021), text is stored in the local Windows code page — for Korean, ANSI_949 (CP949). From R2007 on, text is Unicode; DXF files are UTF-8 (see the ezdxf documentation).

A CAD program on Korean Windows reads those old files as CP949, so nobody at the office notices. On Mac or Linux, or under a different system language, that interpretation often fails and the Korean turns into ???. The characters were misread before any font gets involved, which is why swapping fonts does nothing.

If an office keeps its default save format at 2004 or older, every drawing it sends out is in this state.

Fix — save as a newer format, close, reopen

  1. Open the broken drawing (still showing ???).
  2. SAVEAS → file type AutoCAD 2018 Drawing (*.dwg). Use a new name and keep the original.
  3. Close the drawing.
  4. Open the newly saved file. The Korean text is back.

Step 3 matters. Right after saving, the open drawing still shows ???. You only see the result after closing and reopening.

In BricsCAD you can do it from the command line in one line. Change the path to suit your machine.

(vla-saveas (vla-get-activedocument (vlax-get-acad-object)) "/path/newname.dwg" 60)
; 60 = acR2018_dwg

For many drawings, use permanent_save.lsp below. It saves [original]_UTF8.dwg next to the original.

In some drawings a few strings stayed as ??? even after the R2018 save. For those, follow up with the Cause C fix (switch text styles to a Korean TTF).

What about DWGCODEPAGE?

You'll see advice to change the DWGCODEPAGE variable. Threads on the Bricsys forum report that this alone often doesn't fix it. Re-saving in a newer format was the reliable route.

What we tried that didn't work

All of these fix fonts. When the characters themselves have been misread, any font will draw question marks.

Cause B — the drawing's font isn't on your machine

The most common case. If your newly typed Korean is ??? too, this is it.

ZWCAD has an official guide: How to add system fonts in ZWCAD.

Cause C — SHX Korean shows ???? on Mac/Linux

Even in Unicode (R2007+) drawings, Korean text set in SHX fonts can show ???? on Mac or Linux, because the Windows Korean SHX big fonts aren't available or aren't read correctly there. The Bricsys forum has reports of the same thing.

The fix is to switch the text style to a Korean TrueType font. NanumGothic is free and easy to install on Mac and Linux.

  1. Install NanumGothic (on Linux, usually the fonts-nanum package).
  2. STYLE → pick the broken style → set the font to NanumGothic and turn off big font.
  3. REGENALL.

With many styles, style_fix_nanum.lsp changes them all at once. It changes every style in the drawing, so try it on a copy first.

LISP files

Tested in BricsCAD on Linux. AutoCAD and ZWCAD use the same LISP functions, but we haven't tested them there. Prompt order of commands can differ between programs and versions. The comments inside the files are in Korean; the console messages are in English.

permanent_save.lsp style_fix_nanum.lsp

Load from the command line, with your own path and forward slashes:

(load "C:/Users/you/Downloads/permanent_save.lsp")

Or use APPLOAD and pick the file.

Summary


Questions: [email protected]

LeDeuxions · Field Notes · Pasting CAD drawings into reports as vector