mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
{.convert|utf-8|dec/hex.}
This commit is contained in:
parent
4b5e0205a5
commit
1f713f706e
@ -665,11 +665,30 @@ var
|
|||||||
end; // inc_
|
end; // inc_
|
||||||
|
|
||||||
procedure convert();
|
procedure convert();
|
||||||
|
var
|
||||||
|
dst, s: string;
|
||||||
|
c: ansichar;
|
||||||
begin
|
begin
|
||||||
if sameText(p, 'ansi') and sameText(par(1), 'utf-8') then
|
dst:=par(1);
|
||||||
result:=string(ansiToUTF8(ansistring(par(2))))
|
s:=par(2);
|
||||||
else if sameText(p, 'utf-8') and sameText(par(1), 'ansi') then
|
if sameText(p, 'ansi') and sameText(dst, 'utf-8') then
|
||||||
result:=utf8ToAnsi(ansistring(par(2)))
|
result:=string(ansiToUTF8(ansistring(s)))
|
||||||
|
else if sameText(p, 'utf-8') then
|
||||||
|
if sameText(dst, 'ansi') then
|
||||||
|
result:=utf8ToAnsi(ansistring(s))
|
||||||
|
else if dst='dec' then
|
||||||
|
begin
|
||||||
|
result:='';
|
||||||
|
for c in UTF8encode(s) do
|
||||||
|
result:=result+intToStr(ord(c))+',';
|
||||||
|
setLength(result, length(result)-1);
|
||||||
|
end
|
||||||
|
else if dst='hex' then
|
||||||
|
begin
|
||||||
|
result:='';
|
||||||
|
for c in UTF8encode(s) do
|
||||||
|
result:=result+intToHex(ord(c));
|
||||||
|
end
|
||||||
end; // convert
|
end; // convert
|
||||||
|
|
||||||
procedure encodeuri();
|
procedure encodeuri();
|
||||||
@ -1913,9 +1932,15 @@ try
|
|||||||
disconnect();
|
disconnect();
|
||||||
|
|
||||||
if name = 'stop server' then
|
if name = 'stop server' then
|
||||||
|
- begin
|
||||||
stopServer();
|
stopServer();
|
||||||
|
exit('');
|
||||||
|
end;
|
||||||
if name = 'start server' then
|
if name = 'start server' then
|
||||||
|
begin
|
||||||
startServer();
|
startServer();
|
||||||
|
exit('');
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
if name = 'focus' then
|
if name = 'focus' then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user