From: Artem Bityutskiy Date: Mon, 9 Dec 2013 10:23:36 +0000 (+0200) Subject: utils/gpt_parser.py: fix partitions names X-Git-Tag: 0.23~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=519f89a5518cb24806e0cb10d466c7347dab7597;p=tools%2Fmic.git utils/gpt_parser.py: fix partitions names This patch fixes https://bugs.tizen.org/jira/browse/TIVI-1727. The problem is that we are using 'UTF-16' encoder name, and it adds BOM (http://en.wikipedia.org/wiki/Byte_order_mark#UTF-16), and BOM breaks tools like parted. The GPT spec says that the partition name is UCS-16 Little Endian, so fix this by using 'UTF-16LE' instead, which will not add BOM. I've verified that this fixes TIVI-1727 indeed. Change-Id: If2fff219177bed877873512457b6355dd0118011 Signed-off-by: Artem Bityutskiy --- diff --git a/mic/utils/gpt_parser.py b/mic/utils/gpt_parser.py index 5d43b70..895600d 100644 --- a/mic/utils/gpt_parser.py +++ b/mic/utils/gpt_parser.py @@ -296,7 +296,7 @@ class GptParser: entry['first_lba'], entry['last_lba'], entry['flags'], - entry['name'].encode('UTF-16')) + entry['name'].encode('UTF-16LE')) # Write the updated entry to the disk entry_offs = header['ptable_offs'] + \