Changeset 1217


Ignore:
Timestamp:
2000-06-19T10:56:55+12:00 (24 years ago)
Author:
sjboddie
Message:

fixed a bug that I'd introduced earlier when attempting to get things
compiling on VC++ 6.0 - the gsdl-2.22 release (and possibly 2.21) was
affected and wouldn't have displayed chinese and Arabic characters
correctly

Location:
trunk/gsdl/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/display.cpp

    r1170 r1217  
    2828/*
    2929   $Log$
     30   Revision 1.21  2000/06/18 22:56:55  sjboddie
     31   fixed a bug that I'd introduced earlier when attempting to get things
     32   compiling on VC++ 6.0 - the gsdl-2.22 release (and possibly 2.21) was
     33   affected and wouldn't have displayed chinese and Arabic characters
     34   correctly
     35
    3036   Revision 1.20  2000/05/12 03:09:23  sjboddie
    3137   minor modifications to get web library compiling under VC++ 6.0
     
    687693// bigendian should be set to 1
    688694// 0 will be returned when the end of the file has been found
    689 unsigned short my_uni_get (istream &fin, int &line,
     695unsigned short my_uni_get (unistream &fin, int &line,
    690696               int &isunicode, int &bigendian) {
    691697  unsigned short c = 0;
     
    694700    // unicode text
    695701    // get the next two characters
    696     char c1 = 0, c2 = 0;
     702    unsigned char c1 = 0, c2 = 0;
     703   
    697704    if (!fin.eof()) fin.get(c1);
    698705    if (!fin.eof()) fin.get(c2);
     
    712719    // utf-8 text
    713720    // how many characters we get depends on what we find
    714     char c1 = 0, c2 = 0, c3 = 0;
     721    unsigned char c1 = 0, c2 = 0, c3 = 0;
    715722    while (!fin.eof()) {
    716723      fin.get(c1);
     
    769776 
    770777  // open the file
    771   ifstream fin(filenamestr);
     778  unistream fin (filenamestr);
     779
    772780  if (fin.fail()) return -1; // read failed
    773781
  • trunk/gsdl/lib/display.h

    r1076 r1217  
    6464#  include <iostream.h>
    6565#  include <fstream.h>
     66
     67#define unistream ifstream
     68
    6669#else
    6770#  include <iostream>
    6871#  include <fstream>
     72
     73typedef std::basic_ifstream<unsigned char> unistream;
     74
    6975#endif
    7076
     
    8288// cyclic macros (a includes b and b includes a)
    8389#define MAXRECURSIONDEPTH 30
    84 
    8590
    8691// class prototypes
Note: See TracChangeset for help on using the changeset viewer.