Sign in Join
Wiki copytemporary

OEM2Ansi/de: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-\
21Zurück zur Seite [[code examples/de|Code Beispiele]].\
3-\
2+
43Dieser Artikel beschäftigt sich mit der Windowsprogrammierung.\
54Das Unterprogramm konvertiert eine Datei vom OEM-Zeichensatz (DOS und Windowskonsole) in den ANSI-Zeichensatz.\
65
76``` pascal
87uses
98 Windows, FileUtil, Classes, SysUtils, ...;
109
1110 ...
1211
1312procedure subOEM2Ansi(const conStrQuellDateiname, conStrZielDateiname: string);
1413// konvertiert eine Datei mit Ansi-Zeichensatz in den OEM-Zeichensatz
1514var
1615 txtQuelldatei: file of char;
1716 txtZieldatei: file of char;
1817 chrZeichen: char;
1918 strPuffer: string;
2019
2120begin
2221
2322 assignfile(txtQuelldatei, UTF8ToSys(conStrQuellDateiname));
2423 assignfile(txtZieldatei, UTF8ToSys(conStrZielDateiname));
2524 Rewrite(txtZieldatei);
2625 Reset(txtQuelldatei);
2726 Reset(txtZieldatei);
2827
2928 while not EOF(txtQuelldatei) do
3029 begin
3130
3231 Read(txtQuelldatei, chrZeichen);
3332 strPuffer := chrZeichen;
3433 // Übersetzt den Zeichensatz OEM in den Zeichensatz Ansi
3534 OemToCharBuff(PChar(strPuffer), PChar(strPuffer), Length(strPuffer));
3635 Write(txtZieldatei, char(strPuffer[1]));
3736
3837 end;
3938
4039 closefile(txtQuelldatei);
4140 closefile(txtZieldatei);
4241
4342end;
4443```
4544
46-\
4745Aufruf unter Windows:
4846
4947``` pascal
5048 subOEM2Ansi('E:\Test_alt.txt', 'E:\Test_neu.txt');
5149```
5250
5351---
5452*From the Free Pascal wiki, page "OEM2Ansi/de", as it stood on 2020-02-21 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history