(file) Return to String.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/String.cpp between version 1.70 and 1.71

version 1.70, 2003/08/19 02:08:19 version 1.71, 2003/08/20 17:35:53
Line 628 
Line 628 
  
 CString String::getCStringUTF8() const CString String::getCStringUTF8() const
 { {
     Uint32 n = size() + 1;      Uint32 n = 3*size();
     char* str = new char[n];     char* str = new char[n];
  
     const Char16* msg16 = getChar16Data();     const Char16* msg16 = getChar16Data();
  
     const Uint16 *strsrc = (Uint16 *)msg16;     const Uint16 *strsrc = (Uint16 *)msg16;
     Uint16 *endsrc = (Uint16 *)&msg16[2*n];      Uint16 *endsrc = (Uint16 *)&msg16[size()+1];
  
     Uint8 *strtgt = (Uint8 *)str;     Uint8 *strtgt = (Uint8 *)str;
     Uint8 *endtgt = (Uint8 *)&str[n];     Uint8 *endtgt = (Uint8 *)&str[n];
Line 644 
Line 644 
                  &strtgt,                  &strtgt,
                  endtgt);                  endtgt);
  
     return CString(str);          char* str1 = new char[strlen(str)+1];
           strcpy(str1,str);
           delete str;
   
       return CString(str1);
 } }
  
 Boolean String::isUTF8(const char *legal) Boolean String::isUTF8(const char *legal)


Legend:
Removed from v.1.70  
changed lines
  Added in v.1.71

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2