-
December 9th, 2013, 12:53 AM
#1
Using FILE class to write into txt file in DOS Codepage
I'm using
CString text;
CString file_name;
text = "My text.";
file_name = "MyFile.txt";
FILE *fp;
fp = fopen(file_name, "w+");
fprintf(fp, text + "\n");
fclose(fp);
There will be MyFile.txt in Windows codepage.
How to write to txt file with DOS codepage?
-
December 9th, 2013, 01:12 PM
#2
Re: Using FILE class to write into txt file in DOS Codepage
>> text = "My text."
Those characters have the same code points in all encodings. What characters are you trying to write that are different in the OEM codepage vs ACP codepage?
gg
-
December 12th, 2013, 11:15 PM
#3
Re: Using FILE class to write into txt file in DOS Codepage
Instead of "My text." will be another text.
I can not give you that text.
I must to safe in two txt files:
1. With MS-DOS Encoding.
2. With MS-Windows Encoding.
-
December 14th, 2013, 10:01 PM
#4
Re: Using FILE class to write into txt file in DOS Codepage
Which DOS encoding? Which "Windows" encoding?
In my locale, the DOS encoding is 437 and my ACP is 1252.
gg
-
December 16th, 2013, 10:50 PM
#5
Re: Using FILE class to write into txt file in DOS Codepage
-
December 16th, 2013, 10:51 PM
#6
Re: Using FILE class to write into txt file in DOS Codepage
Thank you.
Which OS do you use?
-
December 16th, 2013, 11:43 PM
#7
Re: Using FILE class to write into txt file in DOS Codepage
CharToOem coverts an ACP encoding into an OEM encoding. The actual codepage depends on the locale. For me, OEM=437 and ACP=1252.
I'm running Win7 with a US locale. Other locales will have different ACP/OEM codepages.
gg
-
December 16th, 2013, 11:53 PM
#8
Re: Using FILE class to write into txt file in DOS Codepage
Thank you.
By the way, could you tell me, which instrument must be used to create some bare metal utilities and OS ?
Originally Posted by Codeplug
CharToOem coverts an ACP encoding into an OEM encoding. The actual codepage depends on the locale. For me, OEM=437 and ACP=1252.
I'm running Win7 with a US locale. Other locales will have different ACP/OEM codepages.
gg
-
December 17th, 2013, 12:33 AM
#9
Re: Using FILE class to write into txt file in DOS Codepage
>> ... which instrument must be used to create some bare metal utilities and OS ?
It may be better if you state exactly what you're trying to achieve. I don't know what "bare metal" means.
gg
-
December 17th, 2013, 03:29 AM
#10
Re: Using FILE class to write into txt file in DOS Codepage
It means without starting operating system (OS) or without installed OS.
Originally Posted by Codeplug
>> ... which instrument must be used to create some bare metal utilities and OS ?
It may be better if you state exactly what you're trying to achieve. I don't know what "bare metal" means.
gg
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|