Changeset 312


Ignore:
Timestamp:
Sep 25, 2009, 5:19:35 PM (10 years ago)
Author:
ksherdy
Message:

Since, Python 2.x's string type acts as an immutable byte array read file data as bytes independent of encoding.
Transpose bytes as before, independent of encoding, just as bytes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/bitutil.py

    r302 r312  
    2828        f.close()
    2929
    30 def readfile(filename, charcode='utf-8'):
    31         f = codecs.open(filename, 'r', encoding=charcode)
    32         contents = f.read() # returns a unicode string from encoded file bytes
     30def readfile(filename):
     31        f = open(filename)
     32        contents = f.read()
    3333        f.close()
    3434        return contents
     
    4848        return bit
    4949
    50 def transpose_u8_byte_streams(s):
     50def transpose_streams(s):
    5151        b = []
    5252        mask = 128
Note: See TracChangeset for help on using the changeset viewer.