ó
Ö–EGc           @   sL   d  d l  Z  y e  j j Z Wn e k
 r5 d Z n Xd „  Z d „  Z d S(   iÿÿÿÿNt   asciic         C   s#   t  |  t ƒ r |  j t d ƒ S|  S(   s=   helper to ensure that text passed to WriteConsoleW is unicodet   replace(   t
   isinstancet   strt   decodet   pyreadline_codepage(   t   text(    (    sI   p:\graphics\tools\python26\lib\site-packages\pyreadline\unicode_helper.pyt   ensure_unicode   s    c         C   s#   t  |  t ƒ r |  j t d ƒ S|  S(   s0   Convert unicode to str using pyreadline_codepageR   (   R   t   unicodet   encodeR   (   R   (    (    sI   p:\graphics\tools\python26\lib\site-packages\pyreadline\unicode_helper.pyt
   ensure_str   s    (   t   syst   stdoutt   encodingR   t   AttributeErrorR   R
   (    (    (    sI   p:\graphics\tools\python26\lib\site-packages\pyreadline\unicode_helper.pyt   <module>   s   
	