twitter/finagle — pull request #150 by mosesn (2013-04-02 18:08:00+00:00)
Title: makes finagle-mysql charsets extensible

## motivation
Some people have mysql databases with different character encodings. finagle-mysql doesn't support a lot right now, but it should in the future.

## implementation
This is a more complicated problem than you might think at first, because different columns can theoretically be different charsets within a single database.

## todo

### prepared statements
I only added support for Latin-1 in this PR, because it lets me punt on encoding prepared statements. For prepared statements, we don't need to declare anything about the charset to mysql, but we do need to encode them. Because latin-1 is compatible with utf-8, this just assumes every string in a prepared statement will use utf-8. More work will need to be done to guarantee that every string in a prepared statement is encoded properly.

### other charsets
The other part of this that isn't complete is that the conversion from mysql collation number to a java.nio.charset is completely punted on, and it always returns utf-8. In the future, there should be a map from collations to charsets.