You can try something like this below to strip the \n and \t characters from the String, but this assumes that the root problem has to do with the \n and \t characters in the String and does not have anything to do with the output buffer or JSON encoding.
Edit WooCommerce File: /woocommerce/includes/class-wc-ajax.php at code line: 170
Add|Edit: str_replace( '\n', '\t', "", $mini_cart )
// Fragments and mini cart are returned
$data = array(
'fragments' => apply_filters( 'woocommerce_add_to_cart_fragments', array(
'div.widget_shopping_cart_content' => '<div class="widget_shopping_cart_content">' . str_replace( '\n', '\t', "", $mini_cart ) . '</div>'
)
),
Browser Output: {"fragments":{"div.widget_shopping_cart_content":"<div class=\"widget_shopping_cart_content\"><\/div>"},"cart_hash":""}