Upcoming changes to character encoding in Shopify

Highlighted
Shopify Staff
Shopify Staff
533 0 82

Hey Shopify Developers,

Starting on Monday July 24th, there will be some changes to how certain properties such as tags and handles are encoded.

Currently Shopify only supports ASCII characters for these properties. Going forward, Shopify will support a full UTF-8 character set for these properties, and you can expect the values of these properties to contain non-ASCII characters.

For example, currently a product with the title 日本 will have a handle autotmatically generated as "" (an empty string), as there are no ASCII characters in the title. Going forward, the handle would now be generated as 日本 and the product page would be found at the URL https://johns-apparel.myshopify.com/products/日本. 

Here's an example JSON representation of a product with a non-ASCII handle:

{
	"product": {
		"id": 11125239118,
		"title": "日本",
		"body_html": "こんにちは!",
		"vendor": "Jamie D's Emporium",
		"product_type": "",
		"created_at": "2017-07-11T17:34:29-04:00",
		"handle": "日本",
		"updated_at": "2017-07-11T17:35:09-04:00",
		"published_at": "2017-07-11T17:33:50-04:00",
		"template_suffix": "",
		"published_scope": "global",
		"tags": "",
		"variants": [{
			"id": 43945333838,
			"product_id": 11125239118,
			"title": "Default Title",
			"price": "19.99",
			"sku": "",
			"position": 1,
			"grams": 0,
			"inventory_policy": "deny",
			"compare_at_price": null,
			"fulfillment_service": "manual",
			"inventory_management": null,
			"option1": "Default Title",
			"option2": null,
			"option3": null,
			"created_at": "2017-07-11T17:34:29-04:00",
			"updated_at": "2017-07-11T17:34:29-04:00",
			"taxable": true,
			"barcode": "",
			"image_id": null,
			"inventory_quantity": 1,
			"weight": 0,
			"weight_unit": "kg",
			"old_inventory_quantity": 1,
			"requires_shipping": true
		}],
		"options": [{
			"id": 13627415438,
			"product_id": 11125239118,
			"name": "Title",
			"position": 1,
			"values": [
				"Default Title"
			]
		}],
		"images": [],
		"image": null
	}
}

Your application must be prepared to parse any non-ASCII characters present in the data returned by Shopify. For maximum robustness, your application should be prepared to handle any string value from Shopify that might contain non-ASCII characters. It is likely that in the future, more parameters will support a full set of UTF-8 characters.

If your application relies on Javascript to parse the URL, for example on a product page, you will also need to prepare to handle any non-ASCII characters present here as well.

Keep in mind that this option won't necessarily be available to all merchants immediately on July 24th – this notice is simply to prepare platform developers to handle these changes.

As always, if you have any questions or concerns please reply directly in this thread.

Thanks!

1 Like
Shopify Expert
9418 9 1258

Even if no one else says it - I'm super excited to see this in the wild.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Shopify Partner
28 0 3

Will this have any affect on customer information at checkout is handled, like addresses in non-Roman characters?

Hidden Gears: Web Design, Development + Digital Marketing
0 Likes
Shopify Staff
Shopify Staff
533 0 82

Customer addresses already support a full UTF-8 charset, so there shouldn't be any changes there.

Best practice going forward is to assume that any string data sent by Shopify might contain non-ASCII characters.

0 Likes
Shopify Partner
113 0 41

@Jason: same here :) 

Better customer experience for our Japanese customers, and less dirty tweaky liquid to handle tags containing Japanese !

★Shopify tweaker★
0 Likes
Shopify Partner
695 0 86

Some very good news!

0 Likes
Shopify Expert
417 2 61

Has this feature been made available to all stores yet? Because it appears that special characters in handles are still being converted, e.g. ß -> ss and ü -> u and when creating a product with special characters in its name, these are still being replaced with dashes.

★ ThemeUp: Nifty Upgrades for your Shopify Store ★ https://themeup.net
0 Likes
Shopify Partner
113 0 41

Well, 8th months and still nothing. 
Seriously, Shopify... when making an announcement, make sure it's - at least - on your todo list... 

★Shopify tweaker★
1 Like