Click here to Skip to main content
16,010,876 members
Home / Discussions / C#
   

C#

 
QuestionCan someone tell me how to solve this problem? Pin
Silvyster12-Apr-08 17:52
Silvyster12-Apr-08 17:52 
GeneralRe: Can someone tell me how to solve this problem? Pin
Christian Graus12-Apr-08 18:24
protectorChristian Graus12-Apr-08 18:24 
GeneralRe: Can someone tell me how to solve this problem? Pin
PIEBALDconsult13-Apr-08 5:32
mvePIEBALDconsult13-Apr-08 5:32 
GeneralRe: Can someone tell me how to solve this problem? Pin
Silvyster13-Apr-08 13:10
Silvyster13-Apr-08 13:10 
GeneralRe: Can someone tell me how to solve this problem? Pin
PIEBALDconsult13-Apr-08 14:18
mvePIEBALDconsult13-Apr-08 14:18 
GeneralRe: Can someone tell me how to solve this problem? Pin
Silvyster13-Apr-08 18:34
Silvyster13-Apr-08 18:34 
GeneralRe: Can someone tell me how to solve this problem? Pin
PIEBALDconsult14-Apr-08 17:01
mvePIEBALDconsult14-Apr-08 17:01 
QuestionEncoding info of a certain file Pin
califgal12-Apr-08 16:09
califgal12-Apr-08 16:09 
hi, if I use the following code, even if I saved the txt file to Ansi codepage instead of UTF8, the StreamReader sr always gets UTF8 encoding and thus returns [239][187][191] which is UTFS-8 ByteOrderMark value. Ansi or other encodings than UTFS-8 w/BOM should not have those values. Can anyone please help me how to correct this to return correct current encoding of a file?


using System;
using System.IO;
using System.Text;

class Test
{

public static void Main()
{
string path = @"d:\work\ansi.txt";

try
{
if (File.Exists(path))
{
}
using (StreamReader sr = new StreamReader(path, true))
{
byte[] byteordermark;
while (sr.Peek() >= 0)
{
Console.Write((char)sr.Read());
}
byteordermark = sr.CurrentEncoding.GetPreamble();
ShowArray(byteordermark);
}
}
catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}


}
public static void ShowArray(Array theArray)
{
foreach (Object o in theArray)
{
Console.Write("[{0}]", o);
}
Console.WriteLine();
}
}
GeneralRe: Encoding info of a certain file Pin
Elina Blank16-Apr-08 7:09
sitebuilderElina Blank16-Apr-08 7:09 
QuestionPeriodic update [modified] Pin
GIS Anthony12-Apr-08 15:46
GIS Anthony12-Apr-08 15:46 
GeneralRe: Periodic update Pin
Christian Graus12-Apr-08 16:37
protectorChristian Graus12-Apr-08 16:37 
GeneralRe: Periodic update Pin
GIS Anthony12-Apr-08 16:44
GIS Anthony12-Apr-08 16:44 
GeneralConnecting string ADO.NET for MySQL Pin
Tjie Pouw12-Apr-08 14:08
Tjie Pouw12-Apr-08 14:08 
GeneralRe: Connecting string ADO.NET for MySQL Pin
Christian Graus12-Apr-08 14:10
protectorChristian Graus12-Apr-08 14:10 
GeneralRe: Connecting string ADO.NET for MySQL Pin
Not Active12-Apr-08 14:52
mentorNot Active12-Apr-08 14:52 
GeneralRe: Connecting string ADO.NET for MySQL Pin
Christian Graus12-Apr-08 15:11
protectorChristian Graus12-Apr-08 15:11 
GeneralRe: Connecting string ADO.NET for MySQL Pin
Tjie Pouw12-Apr-08 19:32
Tjie Pouw12-Apr-08 19:32 
GeneralRe: Connecting string ADO.NET for MySQL Pin
Ravenet13-Apr-08 16:09
Ravenet13-Apr-08 16:09 
QuestionRouter Configuration? Pin
AhmedOsamaMoh12-Apr-08 13:15
AhmedOsamaMoh12-Apr-08 13:15 
GeneralConverting string to byte Pin
GuyThiebaut12-Apr-08 10:13
professionalGuyThiebaut12-Apr-08 10:13 
GeneralRe: Converting string to byte Pin
Ed.Poore12-Apr-08 10:51
Ed.Poore12-Apr-08 10:51 
GeneralRe: Converting string to byte Pin
GuyThiebaut12-Apr-08 11:05
professionalGuyThiebaut12-Apr-08 11:05 
GeneralRe: Converting string to byte Pin
Guffa12-Apr-08 11:26
Guffa12-Apr-08 11:26 
GeneralRe: Converting string to byte Pin
GuyThiebaut12-Apr-08 11:31
professionalGuyThiebaut12-Apr-08 11:31 
GeneralRe: Converting string to byte Pin
Ed.Poore12-Apr-08 11:35
Ed.Poore12-Apr-08 11:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.