diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-12 19:07:39 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-12 19:07:39 +0000 |
commit | 9033f7e98be7a2bc9221af9903ac5b8b1d098782 (patch) | |
tree | cda6f3eb1c00ae601b190e9022b3ffc7d40efa6b /src | |
parent | 8ffb63b7d7ce0a5d96d1f07413e50dcee2a54dcd (diff) | |
download | usdx-9033f7e98be7a2bc9221af9903ac5b8b1d098782.tar.gz usdx-9033f7e98be7a2bc9221af9903ac5b8b1d098782.tar.xz usdx-9033f7e98be7a2bc9221af9903ac5b8b1d098782.zip |
Previously removed option Lyrics:Encoding now back in config.ini:
- Possible values: Auto/CP1250/CP1252/UTF8/Locale
- Default: Auto
- Recommended: Auto or UTF8
- IMPORTANT: CP1250(old US default), CP1252 (old USDX default) and Locale (country specific) are only for backwards compatibility and should not be used as they break portability
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2507 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src')
-rw-r--r-- | src/base/UIni.pas | 9 | ||||
-rw-r--r-- | src/base/USong.pas | 7 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/base/UIni.pas b/src/base/UIni.pas index 6d01ddc1..b198f22c 100644 --- a/src/base/UIni.pas +++ b/src/base/UIni.pas @@ -170,6 +170,9 @@ type Joypad: integer; Mouse: integer; + // default encoding for texts (lyrics, song-name, ...) + DefaultEncoding: TEncoding; + procedure Load(); procedure Save(); procedure SaveNames; @@ -982,6 +985,9 @@ begin // NoteLines NoteLines := GetArrayIndex(INoteLines, IniFile.ReadString('Lyrics', 'NoteLines', INoteLines[1])); + // DefaultEncoding + DefaultEncoding := ParseEncoding(IniFile.ReadString('Lyrics', 'Encoding', ''), encAuto); + LoadThemes(IniFile); LoadInputDeviceCfg(IniFile); @@ -1138,6 +1144,9 @@ begin // NoteLines IniFile.WriteString('Lyrics', 'NoteLines', INoteLines[NoteLines]); + //Encoding default + IniFile.WriteString('Lyrics', 'Encoding', EncodingName(DefaultEncoding)); + // Theme IniFile.WriteString('Themes', 'Theme', ITheme[Theme]); diff --git a/src/base/USong.pas b/src/base/USong.pas index 43251f8f..e92c5b45 100644 --- a/src/base/USong.pas +++ b/src/base/USong.pas @@ -179,9 +179,6 @@ uses UMusic, //needed for Lines UNote; //needed for Player -const - DEFAULT_ENCODING = encAuto; - constructor TSong.Create(); begin inherited; @@ -1090,7 +1087,7 @@ begin // File encoding else if (Identifier = 'ENCODING') then begin - self.Encoding := ParseEncoding(Value, DEFAULT_ENCODING); + self.Encoding := ParseEncoding(Value, Ini.DefaultEncoding); end // unsupported tag @@ -1239,7 +1236,7 @@ begin Year := 0; // set to default encoding - Encoding := DEFAULT_ENCODING; + Encoding := Ini.DefaultEncoding; // clear custom header tags SetLength(CustomTags, 0); |