title: Avoid converting numbers to characters in Erlang
body: <p>I am having trouble with Erlang converting listed numbers to characters whenever none of the listed items could not also be representing a character.</p>
  <p>I am writing a function to separate all the numbers in a positive integer and put them in a list, for example: <code>digitize(123)</code> should return <code>[1,2,3]</code> and so on.</p>
  <p>The following code works fine, except when the list only consist of 8's and/or 9's:</p>
  <pre><code>digitize(_N) when _N =:= 0 -&gt; [];
  digitize(_N) when _N &gt; 0 -&gt; _H = [_N rem 10], _T = digitize(_N div 10), _T ++ _H.
  </code></pre>
  <p>For example: Instead of <code>digitize(8)</code> returning <code>[8]</code>, it gives me the nongraphic character <code>&quot;\b&quot;</code> and <code>digitize(89)</code> returns <code>&quot;\b\t&quot;</code>. This is only for numbers 8 and 9 and when they're put alone inside the list. <code>digitize(891)</code> will correctly return <code>[8,9,1]</code> for example.</p>
  <p>I am aware of the reason for this but how can I solve it without altering my result? (ex: to contain empty lists inside the result like <code>[[],[8]]</code> for <code>digitize(8)</code>).</p>