- - PR -
スマートモバイルアプリケーションでの日本語の処理に関して
1
投稿者 | 投稿内容 | ||||||||
---|---|---|---|---|---|---|---|---|---|
|
投稿日時: 2004-06-08 19:11
基本的な内容で、申し訳ないのですが、VS.NET2003でCE.NETスマートモバイルアプリケーションを開発中なのですが、漢字を含むテキストファイルの文字列をStreamreader若しくは、Textreaderで読み込んでも、漢字(日本語)を読み取ることが出来ません。
どうすれば、漢字も含めて取得することが出来るのでしょうか? | ||||||||
|
投稿日時: 2004-06-08 19:24
原因はおそらく、エンコーディングの指定あたりだとは思いますが、念のため、どのような処理を行っているか知りたいので、問題個所のソースを提示してください。
| ||||||||
|
投稿日時: 2004-06-08 23:25
ソースの件ですがヘルプのサンプルコードのまま記述しました。
Imports System Imports System.IO Class Test Public Shared Sub Main() Try ' Create an instance of StreamReader to read from a file. Dim sr As StreamReader = New StreamReader("TestFile.txt") Dim line As String ' Read and display the lines from the file until the end ' of the file is reached. Do line = sr.ReadLine() Console.WriteLine(Line) Loop Until line Is Nothing sr.Close() Catch E As Exception ' Let the user know what went wrong. Console.WriteLine("The file could not be read:") Console.WriteLine(E.Message) End Try End Sub End Class | ||||||||
|
投稿日時: 2004-06-09 00:37
諸農です。
StreamReaderのコンストラクタに読み取りたい漢字コードの Encodingクラスを渡してみるとどうなりますか? _________________ 諸農和岳 Powered by Turbo Delphi & Microsoft Visual Studio 2005 十兵衛@わんくま同盟 http://blogs.wankuma.com/jubei/ |
1