Logo Search packages:      
Sourcecode: zope-coreblog2 version File versions  Download package

def COREBlog2::COREBlogTool::COREBlog2Tool::convert_charcode (   self,
  s,
  fromcodestr = "" 
)

convert charcode (for Japanese)

Definition at line 209 of file COREBlogTool.py.

                               :
            #unicode -> str
            s = s.encode('utf-8')
            fromcodestr = code_utf8

        retstr = s

        try:
            import pykf
            pykf_fromcodemap = { \
                pykf.EUC : "euc-jp",
                pykf.SJIS: "shift_jis",
                pykf.UTF8: "utf-8",
                pykf.JIS : "iso-2022-jp" }
            pkf_fromcode = 0
            if not fromcodestr:
                #fromcode is unknown... so do 'guess'
                fromcodestr = self.guess_encode(s)

            #Do conversion...
            retstr = unicode(s, fromcodestr, "ignore").encode('utf8')
        except:
            pass
        return retstr

    security.declarePublic('send_mail')
    def send_mail(self, body,to_addr,from_addr,subject):
        #


Generated by  Doxygen 1.6.0   Back to index