//CoolSlob哎哟直叫~~累S我了~~
:zswang,咱们呵上两杯茶再说吧~
  我帮你扫这么久地,真是累S我乐~~

解决方案 »

  1.   

    CoolSlob~~真乖~~奖给你一根棒棒糖~~
      

  2.   

    偶帮你扫这个久的地,就一根呀??!偶对你信骚扰过,有没有看到??!
    Delphi的VCL不支持Unicode,真是可恶~~偶现在贬为“垃圾”了,以后你扫偶的时候可以幽着点哈,别太粗鲁了~~
      

  3.   

    Reply.Last.Text := StringReplace(Reply.Last.Text, '以', '要', [rfReplaceAll])
      

  4.   

    什么是 Unicode?
    历史上, 有两个独立的, 创立单一字符集的尝试. 一个是国际标准化组织(ISO)的 ISO 10646 项目, 另一个是由(一开始大多是美国的)多语言软件制造商组成的协会组织的 Unicode 项目. 幸运的是, 1991年前后, 两个项目的参与者都认识到, 世界不需要两个不同的单一字符集. 它们合并双方的工作成果, 并为创立一个单一编码表而协同工作. 两个项目仍都存在并独立地公布各自的标准, 但 Unicode 协会和 ISO/IEC JTC1/SC2 都同意保持 Unicode 和 ISO 10646 标准的码表兼容, 并紧密地共同调整任何未来的扩展.“还在查资料呢~!”
    http://www.unicode.org/unicode/standard/standard.html
      

  5.   

    什么编程语言支持 Unicode?
    在大约 1993 年之后开发的大多数现代编程语言都有一个特别的数据类型, 叫做 Unicode/ISO 10646-1 字符. 在 Ada95 中叫 Wide_Character, 在 Java 中叫 char.ISO C 也详细说明了处理多字节编码和宽字符 (wide characters) 的机制, 1994 年 9 月 Amendment 1 to ISO C 发表时又加入了更多. 这些机制主要是为各类东亚编码而设计的, 它们比处理 UCS 所需的要健壮得多. UTF-8 是 ISO C 标准调用多字节字符串的编码的一个例子, wchar_t 类型可以用来存放 Unicode 字符.
      

  6.   

    对Unicode的支持要改获取字符的源码,它每次都屏蔽掉了#0,如果改回去就中;
    而如何判断,俺不会,估计delphi难
      

  7.   

    >Reply.Last.Text := StringReplace(Reply.Last.Text, '以', '要', [rfReplaceAll])
    Reply是什么?怎么声明的?
      

  8.   

    小小,去~~把那呆子叫醒~PP都坐热了,茶还没上~~zswang:
      osql -S%s -d%s -U%s -P%s -i%s -o%s\Script.err -u这样输出的Script.err是Unicode文件,使用TStringList.LoadFormFile之后只能显示一丁点(遇到#0之前的那些)
      

  9.   

    Reply是我声明的~我上一个回复打错了一字~~:)
      

  10.   

    靠,让俺给你叫人?俺pp还没有做热;
    你怎么不去啊?那呆子早就让他的三个GF给搞晕了;
    茶要苦的,最便宜的那种;///////省下银子给小小啊;
    你要是单纯的显示,可以做出来的,你上次明明上俺判断它的嘛
    而且,Unicode 和 String两者去掉#0是一样的;对String没有影响的;
      

  11.   

    TStrings里不能处理功能字符,要不就用TFileStream或者string来处理~~越看越不明白~~能给个输入、输出范例吗?~~想调试看看~~
      

  12.   

    嘻嘻:)The IsTextUnicode function determines whether a buffer probably contains a form of Unicode text. The function uses various statistical and deterministic methods to make its determination, under the control of flags passed via lpi. When the function returns, the results of such tests are reported via lpi. If all specified tests are passed, the function returns TRUE; otherwise, it returns FALSE.DWORD IsTextUnicode(    CONST LPVOID lpBuffer, // pointer to an input buffer to be examined
        int cb, // the size in bytes of the input buffer
        LPINT lpi // pointer to flags that condition text examination and receive results
       );摩托告诉俺di~~:)
      

  13.   

    Unicode文档:http://CoolSlob.ifood1.com/Download/Script.err你用TStrings Load它,然后ShowMessage它的值,看看:)
      

  14.   

    摩托来晚了:摩托以前也遇到类似的问题,找到了IsTextUnicode函数,似乎还起点作用,呵呵!还有找到一点资料,刚才给CoolSlob兄了,大家分享:
    如果一篇文本以0xff 0xfe开头,那么就是unicode码,否则ansi。
      

  15.   

    Socket ErrorHost name lookup for 'coolslob.ifood1.com' failed
      

  16.   

    摩托~~回来~~回来~~我不知道怎么用IsTextUnicode呀~~
      

  17.   

    zswang:
      J到你邮箱里去了~~btw:你怎么会出这个错呀?直接在IE地址栏输入下载就是呀~~
      

  18.   

    if IsTextUnicode(pchar(widestring(edit1.text)),length(edit1.Text ),nil)then showmessage('ok')
      

  19.   

    function FileToString(mFileName: TFileName): string;
    { 返回从文件载入字符串 }
    var
      vFileChar: file of Char;
      vChar: Char;
    begin
      Result := '';
      {$I-}
      AssignFile(vFileChar, mFileName);
      Reset(vFileChar);  while not Eof(vFileChar) do begin
        Read(vFileChar, vChar);
        Result := Result + vChar;
      end;
      CloseFile(vFileChar);
      {$I+}
    end; { FileToString }function StringToDisplay(mString: string): string;
    var
      I: Integer;
      S: string;
    begin
      Result := '';
      S := '';
      for I := 1 to Length(mString) do
        if mString[I] in [#32..#127] then
          S := S + mString[I]
        else begin
          if S <> '' then begin
            Result := Result + QuotedStr(S);
            S := '';
          end;
          Result := Result + Format('#$%x', [Ord(mString[I])]);
        end;
      if S <> '' then Result := Result + QuotedStr(S);
    end; { StringToDisplay }procedure TForm1.Button1Click(Sender: TObject);
    const
      cFileName = 'C:\Temp\Script.err';
    var
      S: string;
      I: Integer;
    begin
      S := FileToString(cFileName);
      for I := Length(S) downto 1 do
        if S[I] in [#$0..#$8] then
          Delete(S, I, 1);
      ShowMessage(Copy(S, 3, MaxInt));
      ShowMessage(StringToDisplay(S));
    end;
      

  20.   

    procedure TStrings.SetTextStr(const Value: string);
    var
      P, Start: PChar;
      S: string;
      tmp: string;
    begin
      BeginUpdate;
      try
        Clear;
        tmp := Value;
        if (Ord(tmp[1]) = $ff) and (Ord(tmp[2]) = $fe) then
        begin
          tmp := WideCharToString(PWideChar(Value));
          P := Pointer(tmp);
        end
        else P := Pointer(Value);
        if P <> nil then
          while P^ <> #0 do
          begin
            Start := P;
            while not (P^ in [#0, #10, #13]) do Inc(P);
            SetString(S, Start, P - Start);
            Add(S);
            if P^ = #13 then Inc(P);
            if P^ = #10 then Inc(P);
          end;
      finally
        EndUpdate;
      end;
    end;--晕,,,去年做好的,现在要用,,又给忘了.存到这里来:)