Woocommerce order item meta special characters encoding

When creating a new order, I add some metadata to some order items. I do it in this way

wc_add_order_item_meta($item_id, '_myData', array(
    'text' => array('Gött mos')
))

However, when I get the item meta back using wc_get_order_item_meta the string Gött mos is replaced with the string G00f6tt mos. After looking it up a little bit, it seems like the character ö is replaced with some kind of unicode representation of the same character. How do I get the text back without it being “encoded”?

Read More

EDIT:

I just discovered that wc_add_order_item_meta is a plain proxy of WordPress’s function add_postmeta, which makes this a problem with a WordPress functions rather than Woocommerce.

Related posts