Converting Letters to Numbers 2
<p>Refer to <a href="http://stackoverflow.com/questions/10644420/converting-letters-to-numbers">Converting Letters to Numbers</a></p>

<p>In the file <code>test.in.rtf</code>, I have 'abcd' typed. However, when I run the program, I get <code>??? ???????????  ???????? plus maybe a few more</code> in <code>test.out.rtf</code>. Why is this? Am I missing something?</p>

<pre><code>import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Test {

    public static void main(String[] args) throws IOException  {

        BufferedReader f = new BufferedReader(new FileReader("test.in.rtf"));

        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("test.out.rtf")));

        StringTokenizer st = new StringTokenizer(f.readLine());


        StringBuilder sb = new StringBuilder();

        for (char c : st.nextToken().toCharArray()) {
            sb.append((char)(c - 'a' + 1));
        }

        out.println(sb);                           // output result
        out.close();                                  // close the output file
        System.exit(0);
    }

}
</code></pre>
