Link to home
Start Free TrialLog in
Avatar of hema_jone_mickey
hema_jone_mickey

asked on

how to convert Apple mac text file,to a normal windows encoding

hi i want to read a file written on a mac os. could this be done
in c#
Avatar of SRigney
SRigney
Flag of United States of America image

If the file is saved in text format then yes it should be possible.

Apple only uses the either the Line Feed or Carriage Return character at the end of each line (not sure which one), while Windows uses Line Feed and Carriage Return, but other than that there shouldn't be a problem.
Avatar of hema_jone_mickey
hema_jone_mickey

ASKER

i used the following code
FileStream ReadPdf = new FileStream("c:\\test.txt", FileMode.Open);
                  long FileSize;
                  FileSize = ReadPdf.Length;
                  byte[] Buffer = new byte[(int)FileSize];
                  ReadPdf.Read(Buffer, 0, (int)ReadPdf.Length);

                  String str = System.Text.Encoding.Default.GetString(Buffer);

                        ReadPdf.Close();

but it's supposed it's Arabic ,it returned arabic words but no understandable

so what is the solution ,and what type to save the file in
and thanks
an dhow to do it  SRigney
How did you get the file from the Apple into the Windows operating system?

Ftp is my preferred method.
i don't ask how to get the file ,i ask about the conversion to the readable format by windows .how to convert from C# Code the MAC FORMAT TO THE WINDOWS FORMAT?
ASKER CERTIFIED SOLUTION
Avatar of SRigney
SRigney
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial