aboutsummaryrefslogtreecommitdiffstats
path: root/Lua/src/encoding/Locale.inc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Lua/src/encoding/Locale.inc (renamed from Lua/src/base/UModules.pas)56
1 files changed, 28 insertions, 28 deletions
diff --git a/Lua/src/base/UModules.pas b/Lua/src/encoding/Locale.inc
index 97494180..a3cdcebc 100644
--- a/Lua/src/base/UModules.pas
+++ b/Lua/src/encoding/Locale.inc
@@ -23,33 +23,33 @@
* $Id$
*}
-unit UModules;
-
-interface
-
-{$IFDEF FPC}
- {$MODE Delphi}
-{$ENDIF}
-
-{$I switches.inc}
-
-{*********************
- UModules
- Unit Contains all used Modules in its uses clausel
- and a const with an array of all Modules to load
-*********************}
-
-uses
- UCoreModule,
- UPluginLoader;
-
-const
- CORE_MODULES_TO_LOAD: Array[0..2] of cCoreModule = (
- TPluginLoader, //First because it has to look if there are Module replacements (Feature o/t Future)
- TCoreModule, //Remove this later, just a dummy
- TtehPlugins //Represents the Plugins. Last because they may use CoreModules Services etc.
- );
+{*
+ * Locale
+ *}
-implementation
+type
+ TEncoderLocale = class(TEncoder)
+ public
+ function GetName(): AnsiString; override;
+ function Encode(const InStr: UCS4String; out OutStr: AnsiString): boolean; override;
+ function Decode(const InStr: AnsiString; out OutStr: UCS4String): boolean; override;
+ end;
+
+function TEncoderLocale.GetName(): AnsiString;
+begin
+ Result := 'LOCALE';
+end;
+
+function TEncoderLocale.Decode(const InStr: AnsiString; out OutStr: UCS4String): boolean;
+begin
+ OutStr := WideStringToUCS4String(InStr); // use implicit conversion
+ Result := true;
+end;
+
+function TEncoderLocale.Encode(const InStr: UCS4String; out OutStr: AnsiString): boolean;
+begin
+ OutStr := UCS4StringToWideString(InStr); // use implicit conversion
+ // any way to check for errors?
+ Result := true;
+end;
-end. \ No newline at end of file