Daniel YC Lin
Daniel YC Lin

Reputation: 16012

any utility can convert drawing box chars between utf-8 and ascii?

There are some old code in ASCII doc. For example

/* main process
  ┌─┐  ┌─┐  ┌─┐
  │A├─>│B├─>│C│
  └─┘  └─┘  └─┘
 */

I want to convert it from ascii to utf-8. I've tried uni2ascii, but failed.

http://en.wikipedia.org/wiki/Box-drawing_character

Upvotes: 0

Views: 493

Answers (1)

rob mayoff
rob mayoff

Reputation: 385670

Let's be precise: the ASCII character set does not include those line-drawing characters. Your file is using some other character set. You need to figure out what character set (or “code page”) your file was written for. Then you can use a utility like iconv to convert it to UTF-8.

For example, if it was written for code page 437, you can convert it to UTF-8 like this:

iconv -f CP437 -t UTF8 < myfile.c > utf8-myfile.c

Upvotes: 3

Related Questions