~sayanriju/muktalekhaa/trunk

« back to all changes in this revision

Viewing changes to beditor.py

  • Committer: Sayan Chakrabarti
  • Date: 2010-02-03 15:53:45 UTC
  • Revision ID: me@sayanriju.co.cc-20100203155345-g36epohlvvc9rjgp
encode() replaced by unicode()

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
 
# coding: utf-8
 
2
# -*- coding: utf-8 -*-
 
3
 
3
4
## beditor.py
4
5
 
5
6
###############################################################################################
24
25
 
25
26
 
26
27
''' Beditor : The GUI editor part of Muktalekhaa '''
27
 
 
 
28
import wxversion
 
29
wxversion.select('2.6.0-unicode')
28
30
import wx
 
31
 
29
32
import os
30
33
import engine
31
34
 
443
446
                        if 32 < keycode <= 126:
444
447
                                key = chr(keycode)
445
448
                                self.word += key
446
 
                                self.statusbar.SetStatusText(engine.roman2beng(self.word.encode('utf-8')),0)
 
449
                                self.statusbar.SetStatusText(unicode(engine.roman2beng(self.word),'utf-8'),0)
447
450
                        elif keycode == wx.WXK_SPACE:
448
451
                                self.statusbar.SetStatusText('',0)
449
452
                                self.word = ''
517
520
                                cur_word = cur_word[1:]
518
521
                        
519
522
                        if not self.convert.IsChecked():
520
 
                                self.text.Replace(sow, self.text.GetInsertionPoint(), engine.roman2beng(cur_word.encode('utf-8') ))
 
523
                                self.text.Replace(sow, self.text.GetInsertionPoint(), unicode(engine.roman2beng(cur_word),'utf-8' ))
521
524
        
522
525
        
523
526
                event.Skip()