d
Topic
Jamie D. Developer Experience
Posts:
533
Last edited July 11, 2017
g
1
upvotes

Upcoming changes to character encoding in Shopify This post is outdated

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!

i
Replies
Jason Shopify Expert freakdesign.com.au
Posts:
9236
July 12, 2017

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
Posts:
27
July 12, 2017

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
Jamie D. Developer Experience
Posts:
533
July 12, 2017

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.

Jordy Shopify Partner www.seidoshop.com
Posts:
113
July 19, 2017

@Jason: same here :) 

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

★Shopify tweaker★
Ricky Shopify Partner www.suture.net
Posts:
692
July 19, 2017

Some very good news!

Posts:
382
Last edited August 26, 2017

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.

Pakete für Ihren Shopify Shop ab €25: https://shop.thomasborowski.de | Individuelles Projekt? Telefon (DE) 0800 SHOPIFY oder http://www.shopifyexperte.de/anfrage | Coming soon: Lernify – Die Shopify Lernplattform – https://www.shopifyexperte.de/lernify-coming-soon/
Jordy Shopify Partner www.seidoshop.com
Posts:
113
9 months ago
g
1
upvotes

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

★Shopify tweaker★