Changeset 2204

Show
Ignore:
Timestamp:
07/08/08 11:50:41 (6 months ago)
Author:
bzr
Message:

config: Set ConfigObj? encoding to UTF-8 so that unicode strings can be saved and read. Hopefully fixes #114.
espeak synth driver: Explicitly set argtypes for espeak_SetVoiceByName so that it automatically converts unicode strings to ascii. All espeak names are ascii, so this should be fine.

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk

    • Property bzr:revision-id:v3-list-QlpoOTFBWSZTWbrL2vUAAB1VgAAQABCAQDrrnqAgAFCgaaGRkxBoTIJ6mmaNRwhndFAoNhZjh_YY4a01fOg1ulgNNC2UrzPdXXEnDpX8XckU4UJC6y9r1A..
      •  

        old new  
        1391392006 jamie@jantrid.net-20080708102731-b46rnm6cphzz5r8l 
        1401402007 jamie@jantrid.net-20080708110110-fm9iiolh2jzd40em 
         1412008 jamie@jantrid.net-20080708114613-18fr7ji049ie7c6h 
    • Property bzr:revision-info
      •  

        old new  
        1 timestamp: 2008-07-08 21:01:10.503999949 +1000 
         1timestamp: 2008-07-08 21:46:13.611000061 +1000 
        22committer: James Teh <jamie@jantrid.net> 
        33properties:  
  • trunk/source/config/__init__.py

    r2177 r2204  
    121121def load(): 
    122122        """Loads the configuration from the configFile. It also takes note of the file's modification time so that L{save} won't loose any changes made to the file while NVDA is running.  
    123 """ 
     123        """ 
    124124        global conf, mtime 
    125125        # If the config file exists, store its mtime. 
     
    127127                mtime = os.path.getmtime(configFileName) 
    128128        confspec.seek(0) 
    129         conf = ConfigObj(configFileName, configspec = confspec, indent_type = "\t") 
     129        conf = ConfigObj(configFileName, configspec = confspec, indent_type = "\t", encoding="UTF-8") 
    130130        # Python converts \r\n to \n when reading files in Windows, so ConfigObj can't determine the true line ending. 
    131131        conf.newlines = "\r\n" 
  • trunk/source/synthDrivers/_espeak.py

    r2177 r2204  
    264264        espeakDLL.espeak_ListVoices.restype=POINTER(POINTER(espeak_VOICE)) 
    265265        espeakDLL.espeak_GetCurrentVoice.restype=POINTER(espeak_VOICE) 
     266        espeakDLL.espeak_SetVoiceByName.argtypes=(c_char_p,) 
    266267        sampleRate=espeakDLL.espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS,300,"synthDrivers",0) 
    267268        if sampleRate<0: