Project

General

Profile

Bug #4448

zfs diff misprints unicode characters

Added by J L over 5 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Start date:
2014-01-09
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Sorry if my explanation is confusing--character sets have never been by strong suit...

It seems that unicode characters are displayed incorrectly in zfs diff output:

[root@smarty ~]# touch /opt/abcdéfg.txt
[root@smarty ~]# zfs diff -HF zones/opt@snapshot
M       /       /opt/
+       F       /opt/abcd\\37777777703\\37777777651fg.txt

\\37777777703\\37777777651 appears to be an octal-escaped equivalent of hex bytes 0xc3 0xa9, which in turn represents 'é' in UTF-8.

Instead, I would expect to see \\303\\251 as the proper octal-escaped equivalent.

A similar issue was reported and fixed here: https://github.com/zfsonlinux/zfs/issues/1172.

For reference, I'm running a SmartOS build from 20131128T230213Z.


Related issues

Related to illumos gate - Feature #6479: ZFS Diff Prints Carriage ReturnsFeedback2015-11-26

Actions

History

#1

Updated by Joshua M. Clulow over 3 years ago

  • Subject changed from 'zfs diff' misprints unicode characters to zfs diff misprints unicode characters
#2

Updated by Joshua M. Clulow over 3 years ago

The cause is sign extension of the (signed) char as it is passed to fprintf() as a vararg argument. I believe these are always at least int or larger.

#3

Updated by Joshua M. Clulow over 3 years ago

  • Assignee set to Joshua M. Clulow
  • Tags deleted (needs-triage)
#4

Updated by Electric Monk over 3 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit b211eb9181f99c20acbf4c528f94cb44b4ca8c31

commit  b211eb9181f99c20acbf4c528f94cb44b4ca8c31
Author: Joshua M. Clulow <jmc@joyent.com>
Date:   2016-01-30T01:54:34.000Z

    4448 zfs diff misprints unicode characters
    Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Matthew Ahrens <mahrens@delphix.com>

#5

Updated by Yuri Pankov over 3 years ago

  • Related to Feature #6479: ZFS Diff Prints Carriage Returns added

Also available in: Atom PDF