Changes between Initial Version and Version 1 of Ticket #59


Ignore:
Timestamp:
08/21/07 16:56:20 (7 years ago)
Author:
xi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59

    • Property Status changed from new to assigned
  • Ticket #59 – Description

    initial v1  
    33I'm using PyYAML to load some nested data from an utf-8 encoded file in Python with: 
    44 
     5{{{ 
    56import yaml 
    67stream=file('data.yaml','r') 
    78data=yaml.load(stream) 
     9}}} 
    810 
    9 The data variable becomes a dictionary with unicode values where is needed. What I want is to put utf-8 strings instead of unicode values to use this data with another library: Cheetah. If I try to use the unicode-type dictionary generated by default with PyYAML I get an UnicodeDecodeError, because de Cheetah strings are in iso-8859-15 and Python tries to decode them to Unicode using ASCII charset tables, so it obiously fails. 
     11The data variable becomes a dictionary with unicode values where is needed. What I want is to put utf-8 strings instead of unicode values to use this data with another library: Cheetah. If I try to use the unicode-type dictionary generated by default with PyYAML I get an `UnicodeDecodeError`, because de Cheetah strings are in iso-8859-15 and Python tries to decode them to Unicode using ASCII charset tables, so it obiously fails. 
    1012 
    1113Is there any way to get an utf-8 coded dictionary?