Faced a problem with detecting file encoding when file is with no encoding preamble Bytes FE and FF (0xFE,0xFF) encoded useing given encoding. The problem was that flash movie, which uses xml data source as input parameter was not able to detect the encoding of the source. (.NET web form) I’ve solved this problem by writeing the preamble in the begining of the Http Response. I think problems of this kind hapens to many programmers.
I used C# code to solve the problem:
byte[] sign=Encoding.UTF8.GetPreamble();
Response.OutputStream.Write(sign,0,sign.Length);
This application is a very easy to use and a very small tool. It is used to transform XML file useing the given XSL file.
Application uses System.Xml, System.Xml.Xslt namespaces and their classes to perform this action.
Application requires Microsoft .NET framework to run.
Please report any bug’s or suggestions related to this easy application.
The C#.NET source code is:
try
{
if ((outputF.ShowDialog()==DialogResult.OK)&&(outputF.FileName!=null)&&(outputF.FileName.Length>0))
{
XslTransform xslt=new XslTransform();
xslt.Load(label2.Text);
xslt.Transform(label1.Text,outputF.FileName);
label3.Text="Complete ...";
}
else
{
label3.Text="No transformation done ...";
}
}
catch(Exception Ex)
{
label3.Text="No transformation done ...";
MessageBox.Show(Ex.ToString());
}
My totem used not to play avi movies. The problem was that
sudo apt-get install totem
installs totem which is based on gstreamer (totem-gstreamer). After i did
sudo apt-get install totem-xine
(it also uninstalled totem-gstreamer) totem started to play divx avi movies. So as you see the totem setup process is easy:)