新石器Wiki

近年はシリコン(石)から進化した便利なもので溢れる時代。そんな気になった事や試した事など記す。

ユーザ用ツール

サイト用ツール


programing:cpp_builder:cpp_builder-tstreamreader


差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

次のリビジョン
前のリビジョン
programing:cpp_builder:cpp_builder-tstreamreader [2020/02/04 17:25] – 作成 yokoprograming:cpp_builder:cpp_builder-tstreamreader [2020/02/04 17:30] (現在) – [コーディング例] yoko
行 1: 行 1:
-TStreamReaderを使ったUTF-8のファイル読み込み +TStreamReaderを使ったUTF-8のファイル読み込み 
-============================================+========================================== 
 +C++Builderで、`fgetwc`関数ではうまくカナ文字などが読み込めなかったので `TStreamReader` 関数を利用した。
  
 コーディング例 コーディング例
行 6: 行 7:
  
 <code c> <code c>
-    String fname = L""C:\\test\\sample.txt";+    String fname = L"C:\\test\\sample.txt";
  
     TStreamReader* fs = new TStreamReader(fname, TEncoding::UTF8, true, 1024);     TStreamReader* fs = new TStreamReader(fname, TEncoding::UTF8, true, 1024);
     while (fs->EndOfStream == false)     while (fs->EndOfStream == false)
     {     {
-        UnicodeString s = fs->ReadLine();+        String s = fs->ReadLine();
         ShowMessage(s);         ShowMessage(s);
     }     }
programing/cpp_builder/cpp_builder-tstreamreader.1580804727.txt.gz · 最終更新: 2020/02/04 17:25 by yoko