rtl/inc/ustrings.inc

function UTF8ToUnicode(Dest: PUnicodeChar; MaxDestChars: SizeUInt; Source: PChar; SourceBytes: SizeUInt): SizeUInt;


a) it has "If (PreChar<>13) and FALSE then" and later some big block. with a comment which tells that "and FALSE" is on purpose and block is ignored. ?????

b) after I removed "that block" I got such trimmed src

  while (OutputUnicode<MaxDestChars) and (InputUTF8<SourceBytes) do
    begin
      IBYTE:=byte(Source[InputUTF8]);
      if (IBYTE and $80) = 0 then
        begin
          //One character US-ASCII, convert it to unicode
          if IBYTE = 10 then
            begin
              Dest[OutputUnicode]:=WideChar(IBYTE);
              inc(OutputUnicode);
              PreChar:=IBYTE;
            end
          else
            begin
              Dest[OutputUnicode]:=WideChar(IBYTE);
              inc(OutputUnicode);
              PreChar:=IBYTE;
            end;
          inc(InputUTF8);


here we have 2 identical small blocks after "if IBYTE=10". ?????

Alexey Torgashin

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to