How to update a field programmatically and keep the fields format and array structure?
Calling node_save() won't automatically re-load the node so you'll need to do it manually if you want to see the computed field values:

$node = node_load($my_node_id);
$node-&gt;body['und'][0]['value'] = 'My new text.';

node_save($node);

// Re-load the node from the db
$node = node_load($node-&gt;nid, NULL, TRUE);

// $node-&gt;body now has the values you would expect.


I just tried that and can confirm I get the same behaviour as you (the safe_value is not updated) if the call to node_load() is commented out.