title: Drawing tables in terminal using ANSI box characters
body: <p>I'm trying to print a table that's more pleasant to the eye than the pure text representation of it. basically I want to convert something like this: </p>
  
  <pre><code>+-----+--------+
  | age | weight |
  +-----+--------+
  | 10  | 100    |
  | 80  | 500    |
  +-----+--------+
  </code></pre>
  
  <p>to something like this: </p>
  
  <pre><code>┌─────┬────────┐
  | age | weight |
  ├─────┼────────┤
  │ 10  │   100  │
  │ 80  │  500   │
  └─────┴────────┘
  </code></pre>
  
  <p>here is the screenshot of what I see in terminal: </p>
  
  <p><img src="https://i.stack.imgur.com/9eluo.png" alt="in terminal looks like this"></p>
  
  <p>Notice the gaps between the rows. My problem is that they are not connecting properly while other Unix tools that use ANSI printing look fine in terminal. For example, tree, if I run <code>tree -A</code> in my terminal `I get this: </p>
  
  <p><img src="https://i.stack.imgur.com/Dfdpu.png" alt="tree in terminal"></p>
  
  <p>notice how vertical lines are connected together. it's funny because when I copy and paste the output of tree into my text editor and run my script I get something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/0ubOY.png" alt="tree in my code"></p>
  
  <p>Obviously I'm missing something about printing ANSI chars in terminal and couldn't find anything about it by googling it. can anyone shed some light on this topic? </p>