How do you properly render the body when pulling it from the database using db_select?
I think the 'proper' way to do this is not to get the data directly from the database at all, but to use the built-in field API:

// Get an entity (node in this case).
$node = node_load(1);

// Get the view for the body field
$view = field_view_field('node', $node, 'body');


Doing it this way you won't have to bother negotiating languages or anything that, and the field will be outputted exactly as it is when it's attached to a node display.

If you do want to do it manually, though, you need to use the check_markup() function:

$text = check_markup($body_value, $body_format);


It might be worth taking note of the comments in that function, you need to be careful about accepting an arbitrary filter format without validating it:


  Note: Because filters can inject JavaScript or execute PHP code, security is vital here. When a user supplies a text format, you should validate it using filter_access() before accepting/using it. This is normally done in the validation stage of the Form API. You should for example never make a preview of content in a disallowed format.