'''
Print out data in a clean and structured way specific to the data being
printed
'''

# Import Salt libs
import salt.utils

def double_layer(data, color=True):
    '''
    Print out double layered dict returns (like from list-images and
    list-sizes)
    '''
    colors = salt.utils.get_colors(color)
    for top_key in sorted(data):
        print('{0}{1}{2}'.format(colors['GREEN'], top_key, colors['ENDC']))
        for sec_key in sorted(data[top_key]):
            print('  {0}{1}{2}'.format(
                colors['YELLOW'],
                sec_key,
                colors['ENDC']))
            tval = data[top_key][sec_key]
            for fkey in sorted(tval):
                val = data[top_key][sec_key][fkey]
                if isinstance(val, str) or isinstance(val, int):
                    print('    {0}{1}: {2}{3}'.format(
                        colors['LIGHT_GREEN'],
                        fkey,
                        data[top_key][sec_key][fkey],
                        colors['ENDC']))
                if isinstance(val, dict):
                    print('    {0}{1}:{2}'.format(
                        colors['LIGHT_GREEN'],
                        fkey,
                        colors['ENDC']))
                    for ekey in sorted(val):
                        print('      {0}{1}: {2}{3}'.format(
                            colors['LIGHT_GREEN'],
                            ekey,
                            val[ekey],
                            colors['ENDC']))

@@ -120,16 +120,144 @@
 .utils%0A%0A
+unicode_trans = %7B%0A    0xA0: u' ', # Convert non-breaking space to space%0A    u'%5Cxe2%5Cx80%5Cx93': u'-', # Convert en dash to dash%0A%7D%0A%0A
 def doub
@@ -582,16 +582,105 @@
 _key%5D):%0A
+            newval = unicode(sec_key).translate(unicode_trans).encode('ascii', 'ignore')%0A
         
@@ -761,23 +761,22 @@
         
-sec_key
+newval
 ,%0A      
@@ -1477,24 +1477,127 @@
 orted(val):%0A
+                        newval = unicode(val%5Bekey%5D).translate(unicode_trans).encode('ascii', 'ignore')%0A
             
@@ -1758,25 +1758,22 @@
         
+new
 val
-%5Bekey%5D
 ,%0A      

Handle certain unicode characters for IBM SCE