EZ Exporter: Functions for Handling Special Characters in Your Shopify Data

Some time ago, we've had a few EZ Exporter customers tell us that their suppliers need the CSV data sent to them without any special characters.

It seems that they may be using pretty old systems that only support ASCII encoding instead of the now more standard UTF-8 encoding.

With e-commerce, especially, you pretty much can't really avoid these special characters as you'll have customers buying from you all over the world. Their names might contain Greek characters or accented characters like "João." Unfortunately, there are still many legacy systems and software out there who don't support these.

To be able to accommodate these requirements, we've added 2 new functions to EZ Exporter that can be used in a Calculated Field:

replace_text_with_html_entities(text, entity_type="mnemonic")

This function will search and replace special characters in your data with HTML entities.

For example, if your data contains Greek characters, you can use this function to replace all of them with their HTML entity equivalent. This is actually a use case one of our customers encountered. Their dropshipper wanted them replaced with HTML entities before sending over the data to them.

HTML entities can be encoded in different ways, such as mnemonic or code points. By default the function will convert special characters in the text to mnemonic:

replace_text_with_html_entities("Γ")

The above formula will convert the gamma character to & Gamma;

To replace them using code points instead, simply specify code in the entity_type parameter:

replace_text_with_html_entities("Γ", entity_type="code")

The above formula will output & #915;

normalize_text(text)

This function will automatically convert special accented characters such as Á, Ç, and ô to their closest ASCII equivalent.

For example, if the customer's name is Jôam Doê, you can use a formula like this:

normalize_text({{ shipping_address.name }})

In the exported CSV file, the text will be converted to Joam Doe (the special accented characters are replaced with Latin characters).

If you have any questions or need any help with using these functions, please don't hesitate to reach out!

Tags: new features, shopify, csv export, ez exporter, reporting, dropshipping