summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2015-11-17 08:39:36 +0100
committerErich Eckner <git@eckner.net>2015-11-17 08:39:36 +0100
commit782e6fe17e55703b7e05d044257039d1772d022b (patch)
treee4c7a9c371ecf2cc1250a83abaef7cccbf2a471c
parentfffff08da8c4ccc86f30cae996e68a26bc2cfdb5 (diff)
downloadunits-782e6fe17e55703b7e05d044257039d1772d022b.tar.xz
myUtf8Encode neu in lowlevelunit.pas
-rw-r--r--lowlevelunit.pas14
1 files changed, 14 insertions, 0 deletions
diff --git a/lowlevelunit.pas b/lowlevelunit.pas
index 3472049..3977484 100644
--- a/lowlevelunit.pas
+++ b/lowlevelunit.pas
@@ -94,6 +94,7 @@ function mirrorBits(b: byte): byte; overload;
function zusammenfassen(s1,s2: string): string;
function intervallAusrollen(s: string): string;
+function myUtf8Encode(s: string): string;
var
base64Chars: array[0..63] of char;
@@ -832,6 +833,19 @@ begin
result:=trim(result);
end;
+function myUtf8Encode(s: string): string;
+const
+ falsch: string = #$c4#$d6#$dc#$df#$e4#$f6#$fc;
+ richtig: array[1..7] of string = ('Ä','Ö','Ü','ß','ä','ö','ü');
+var
+ i: longint;
+begin
+ result:=s;
+ for i:=1 to length(richtig) do
+ while pos(falsch[i],result)>0 do
+ result:=leftStr(result,pos(falsch[i],result)-1)+richtig[i]+rightStr(result,length(result)-pos(falsch[i],result));
+end;
+
var b: byte;
begin