aboutsummaryrefslogtreecommitdiffstats
path: root/src/base/USong.pas
diff options
context:
space:
mode:
authors_alexander <s_alexander@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-12-05 12:26:00 +0000
committers_alexander <s_alexander@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-12-05 12:26:00 +0000
commitd589e6221ffcafc077eeefaa60cdc3e33a800558 (patch)
treec466f21bcbfa9546a7249b8ed2093e1bf84eeae2 /src/base/USong.pas
parente0d74e92c0c7aa5b4e0fd7ee5fae0bff8e513a27 (diff)
downloadusdx-d589e6221ffcafc077eeefaa60cdc3e33a800558.tar.gz
usdx-d589e6221ffcafc077eeefaa60cdc3e33a800558.tar.xz
usdx-d589e6221ffcafc077eeefaa60cdc3e33a800558.zip
added autodetection of utf8
used w3c regex to match all song lines whether they are utf8 lines and decode it on match as utf8 and as latin1 otherwise git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1964 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base/USong.pas')
-rw-r--r--src/base/USong.pas15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/base/USong.pas b/src/base/USong.pas
index f8d465c7..f8698d43 100644
--- a/src/base/USong.pas
+++ b/src/base/USong.pas
@@ -114,7 +114,7 @@ type
Mp3: IPath;
Background: IPath;
Video: IPath;
-
+
// sorting methods
Genre: UTF8String;
Edition: UTF8String;
@@ -127,7 +127,7 @@ type
Creator: UTF8String;
CoverTex: TTexture;
-
+
VideoGAP: real;
NotesGAP: integer;
Start: real; // in seconds
@@ -180,8 +180,7 @@ uses
UNote; //needed for Player
const
- // use USDX < 1.1 encoding for backward compatibility
- DEFAULT_ENCODING = encCP1252;
+ DEFAULT_ENCODING = encAuto;
constructor TSong.Create();
begin
@@ -381,7 +380,7 @@ begin
LinePos := OldLinePos;
raise EUSDXParseException.Create('Character expected');
end;
- Result := Str[1];
+ Result := Str[1];
end;
{**
@@ -926,7 +925,7 @@ begin
end
else
begin
-
+
//-----------
//Required Attributes
//-----------
@@ -1083,7 +1082,7 @@ begin
begin
AddCustomTag(Identifier, Value);
end;
-
+
end; // End check for non-empty Value
// read next line
@@ -1265,7 +1264,7 @@ begin
//Sortings:
Genre := 'Unknown';
Edition := 'Unknown';
- Language := 'Unknown';
+ Language := 'Unknown';
Year := 0;
// set to default encoding