aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-03 18:39:21 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-03 18:39:21 +0000
commit32f1bc3d4a1e74e2e3c0f3c48a616e2dc21b1ac6 (patch)
treee3c9693acac6102a2d651bb605aa3a0c8029e20e
parent10d6cc6e486d8c5fc01422e7a8fbdcbae402323a (diff)
downloadusdx-32f1bc3d4a1e74e2e3c0f3c48a616e2dc21b1ac6.tar.gz
usdx-32f1bc3d4a1e74e2e3c0f3c48a616e2dc21b1ac6.tar.xz
usdx-32f1bc3d4a1e74e2e3c0f3c48a616e2dc21b1ac6.zip
add AnsiToAscii and AsciiToAnsi. Unused so far
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3173 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--src/base/UUnicodeUtils.pas25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/base/UUnicodeUtils.pas b/src/base/UUnicodeUtils.pas
index 37b53a67..52e40847 100644
--- a/src/base/UUnicodeUtils.pas
+++ b/src/base/UUnicodeUtils.pas
@@ -186,6 +186,9 @@ function WideStringLowerCase(ch: WideChar): WideString; overload;
function WideStringReplaceChar(const text: WideString; search, rep: WideChar): WideString;
+function AnsiToAscii(const s:AnsiString):AnsiString;
+function AsciiToAnsi(const s:AnsiString):AnsiString;
+
implementation
{$IFDEF UNIX}
@@ -664,6 +667,28 @@ begin
end;
end;
+function AnsiToAscii(const s:AnsiString):AnsiString;
+begin
+ Result := s;
+
+ if Result <> '' then
+ begin
+ UniqueString(Result);
+ CharToOem(Pchar(Result), Pchar(Result));
+ end;
+end;
+
+function AsciiToAnsi(const s:AnsiString):AnsiString;
+begin
+ Result := s;
+
+ if Result <> '' then
+ begin
+ UniqueString(Result);
+ OemToChar(Pchar(Result), Pchar(Result));
+ end;
+end;
+
initialization
InitUnicodeUtils;