From a2e19a76894bcdc88874106ae57fa3dc49a13bd1 Mon Sep 17 00:00:00 2001 From: Daniele Teti Date: Wed, 3 Jan 2024 14:31:28 +0100 Subject: [PATCH] FIX some encoding problems introduced by VSCode replace-in-files >:| --- .../MVCFramework.View.Renderers.Sempare.pas | 2 +- samples/commons/RandomUtilsU.pas | 6 +- .../async_client/MainClientFormU.pas | 4 +- .../sync_client/MainClientFormU.pas | 4 +- .../serversideviews_sempare/bin/people.data | 1 + sources/MVCFramework.Commons.pas | 4 +- sources/MVCFramework.RQL.AST2MySQL.pas | 1 + .../MVCFramework.Tests.RESTClient.pas | 12 +- unittests/general/Several/BOs.pas | 2 +- unittests/general/Several/LiveServerTestU.pas | 28 ++-- .../Serializers.JsonDataObjectsTestU.pas | 156 +++++++++--------- .../TestServer/TestServerControllerU.pas | 6 +- 12 files changed, 114 insertions(+), 112 deletions(-) create mode 100644 samples/serversideviews_sempare/bin/people.data diff --git a/contrib/MVCFramework.View.Renderers.Sempare.pas b/contrib/MVCFramework.View.Renderers.Sempare.pas index 105854e3..28f096f4 100644 --- a/contrib/MVCFramework.View.Renderers.Sempare.pas +++ b/contrib/MVCFramework.View.Renderers.Sempare.pas @@ -2,7 +2,7 @@ // // Delphi MVC Framework // -// Copyright (c) 2010-2023 Daniele Teti and the DMVCFramework Team +// Copyright (c) 2010-2024 Daniele Teti and the DMVCFramework Team // // https://github.com/danieleteti/delphimvcframework // diff --git a/samples/commons/RandomUtilsU.pas b/samples/commons/RandomUtilsU.pas index 353bb752..86729e0f 100644 --- a/samples/commons/RandomUtilsU.pas +++ b/samples/commons/RandomUtilsU.pas @@ -2,7 +2,7 @@ // // Delphi MVC Framework // -// Copyright (c) 2010-2024 Daniele Teti and the DMVCFramework Team +// Copyright (c) 2010-2023 Daniele Teti and the DMVCFramework Team // // https://github.com/danieleteti/delphimvcframework // @@ -36,7 +36,7 @@ const 'Tim', 'Joseph', 'David', - 'Ale�', + 'Aleš', 'Thomas' ); @@ -48,7 +48,7 @@ const 'Jones', 'Miller', 'Davis', - 'M�ller', + 'Müller', 'Martinez', 'Anderson' ); diff --git a/samples/jsonrpc_with_published_objects/async_client/MainClientFormU.pas b/samples/jsonrpc_with_published_objects/async_client/MainClientFormU.pas index 60dcdfb6..f56296d6 100644 --- a/samples/jsonrpc_with_published_objects/async_client/MainClientFormU.pas +++ b/samples/jsonrpc_with_published_objects/async_client/MainClientFormU.pas @@ -2,7 +2,7 @@ // // Delphi MVC Framework // -// Copyright (c) 2010-2024 Daniele Teti and the DMVCFramework Team +// Copyright (c) 2010-2023 Daniele Teti and the DMVCFramework Team // // https://github.com/danieleteti/delphimvcframework // @@ -487,7 +487,7 @@ begin for I := 0 to lJSON.Count - 1 do begin lJObj := lJSON[I].ObjectValue; - ListBox1.Items.Add(Format('%6s: %-34s � %5.2f', [lJObj.S['codice'], lJObj.S['descrizione'], lJObj.F['prezzo']])); + ListBox1.Items.Add(Format('%6s: %-34s € %5.2f', [lJObj.S['codice'], lJObj.S['descrizione'], lJObj.F['prezzo']])); end; end); end; diff --git a/samples/jsonrpc_with_published_objects/sync_client/MainClientFormU.pas b/samples/jsonrpc_with_published_objects/sync_client/MainClientFormU.pas index ab5fd195..a238a8bd 100644 --- a/samples/jsonrpc_with_published_objects/sync_client/MainClientFormU.pas +++ b/samples/jsonrpc_with_published_objects/sync_client/MainClientFormU.pas @@ -2,7 +2,7 @@ // // Delphi MVC Framework // -// Copyright (c) 2010-2024 Daniele Teti and the DMVCFramework Team +// Copyright (c) 2010-2023 Daniele Teti and the DMVCFramework Team // // https://github.com/danieleteti/delphimvcframework // @@ -456,7 +456,7 @@ begin for I := 0 to lJSON.Count - 1 do begin lJObj := lJSON[I].ObjectValue; - ListBox1.Items.Add(Format('%6s: %-34s � %5.2f', [lJObj.S['codice'], lJObj.S['descrizione'], lJObj.F['prezzo']])); + ListBox1.Items.Add(Format('%6s: %-34s € %5.2f', [lJObj.S['codice'], lJObj.S['descrizione'], lJObj.F['prezzo']])); end; // lbPerson.Items.Add('First Name:'.PadRight(15) + lJSON.S['firstname']); // lbPerson.Items.Add('Last Name:'.PadRight(15) + lJSON.S['lastname']); diff --git a/samples/serversideviews_sempare/bin/people.data b/samples/serversideviews_sempare/bin/people.data new file mode 100644 index 00000000..67bf8345 --- /dev/null +++ b/samples/serversideviews_sempare/bin/people.data @@ -0,0 +1 @@ +[{"first_name":"Daniele","last_name":"Teti","age":43,"devices":[],"guid":"49E8419B66C744529D63DB292389D541"},{"first_name":"Peter","last_name":"Parker","age":23,"devices":[],"guid":"C5489969A04D4AE4B00D4FC50C8ADB5C"},{"first_name":"Bruce","last_name":"Banner","age":50,"devices":[],"guid":"B41D180F30584558B4F4A1AAF849FFA3"},{"first_name":"Sue","last_name":"Storm","age":33,"devices":[],"guid":"3F058118B8C6470D9684E127BC30A84A"},{"first_name":"Scott","last_name":"Summer","age":35,"devices":[],"guid":"3518D8C6F60E42D19C5A7250ADEADC33"},{"first_name":"Reed","last_name":"Richards","age":45,"devices":["smartphone","desktop"],"guid":"09C85C9DEB714476AADB9EB0AD689536"}] \ No newline at end of file diff --git a/sources/MVCFramework.Commons.pas b/sources/MVCFramework.Commons.pas index d1aecec5..f30c0276 100644 --- a/sources/MVCFramework.Commons.pas +++ b/sources/MVCFramework.Commons.pas @@ -6,7 +6,7 @@ // // https://github.com/danieleteti/delphimvcframework // -// Collaborators on this file: Ezequiel Juliano M�ller (ezequieljuliano@gmail.com) +// Collaborators on this file: Ezequiel Juliano Müller (ezequieljuliano@gmail.com) // // *************************************************************************** // @@ -121,7 +121,7 @@ type LAST_AUTHORIZATION_HEADER_VALUE = '__DMVC_LAST_AUTHORIZATION_HEADER_VALUE_'; SSE_RETRY_DEFAULT = 100; SSE_LAST_EVENT_ID = 'Last-Event-ID'; - URL_MAPPED_PARAMS_ALLOWED_CHARS = ' ������''"@\[\]\{\}\(\)\=;&#\.:!\_,%\w\d\x2D\x3A\$'; + URL_MAPPED_PARAMS_ALLOWED_CHARS = ' àèéùòì''"@\[\]\{\}\(\)\=;&#\.:!\_,%\w\d\x2D\x3A\$'; OneMiB = 1048576; OneKiB = 1024; DEFAULT_MAX_REQUEST_SIZE = OneMiB * 5; // 5 MiB diff --git a/sources/MVCFramework.RQL.AST2MySQL.pas b/sources/MVCFramework.RQL.AST2MySQL.pas index 2c7ea016..2a6fdeb0 100644 --- a/sources/MVCFramework.RQL.AST2MySQL.pas +++ b/sources/MVCFramework.RQL.AST2MySQL.pas @@ -39,6 +39,7 @@ type function RQLLogicOperatorToSQL(const aRQLFIlter: TRQLLogicOperator): string; protected function RQLCustom2SQL(const aRQLCustom: TRQLCustom): string; override; + public function GetTableNameForSQL(const TableName: string): string; override; function GetFieldNameForSQL(const FieldName: string): string; override; end; diff --git a/unittests/general/RESTClient/MVCFramework.Tests.RESTClient.pas b/unittests/general/RESTClient/MVCFramework.Tests.RESTClient.pas index f5f841e5..37813ecb 100644 --- a/unittests/general/RESTClient/MVCFramework.Tests.RESTClient.pas +++ b/unittests/general/RESTClient/MVCFramework.Tests.RESTClient.pas @@ -189,8 +189,8 @@ begin lResp := FRESTClient // .SetBasicAuthorization('dmvc', '123') .AddBodyFieldURLEncoded('field1', 'value1') - .AddBodyFieldURLEncoded('field2', 'Jo�o Ant�nio') - .AddBodyFieldURLEncoded('field3', 'Special characters: ��������s') + .AddBodyFieldURLEncoded('field2', 'João Antônio') + .AddBodyFieldURLEncoded('field3', 'Special characters: öüáàçãõºs') .Post('/body-url-encoded'); Assert.AreEqual(lResp.StatusCode, 200); @@ -198,8 +198,8 @@ begin lJsonResp := TJDOJsonBaseObject.Parse(lResp.Content) as TJDOJsonObject; try Assert.AreEqual('value1', lJsonResp.S['field1']); - Assert.AreEqual('Jo�o Ant�nio', lJsonResp.S['field2']); - Assert.AreEqual('Special characters: ��������s', lJsonResp.S['field3']); + Assert.AreEqual('João Antônio', lJsonResp.S['field2']); + Assert.AreEqual('Special characters: öüáàçãõºs', lJsonResp.S['field3']); finally lJsonResp.Free; end; @@ -364,7 +364,7 @@ begin begin LUser := TAppUser.Create; LUser.Cod := I; - LUser.Name := 'Ezequiel ��������s ' + IntToStr(I); + LUser.Name := 'Ezequiel öüáàçãõºs ' + IntToStr(I); LUser.Pass := IntToStr(I); LUsers.Add(LUser); end; @@ -380,7 +380,7 @@ begin begin LUser := TAppUser.Create; LUser.Cod := I; - LUser.Name := 'Ezequiel ��������s ' + IntToStr(I); + LUser.Name := 'Ezequiel öüáàçãõºs ' + IntToStr(I); LUser.Pass := IntToStr(I); LUsers.Add(LUser); end; diff --git a/unittests/general/Several/BOs.pas b/unittests/general/Several/BOs.pas index 33d8da4c..ceda3884 100644 --- a/unittests/general/Several/BOs.pas +++ b/unittests/general/Several/BOs.pas @@ -763,7 +763,7 @@ end; function GetMyObject: TMyObject; begin Result := TMyObject.Create; - Result.PropString := 'Some text ������'; + Result.PropString := 'Some text àèéìòù'; Result.PropAnsiString := 'This is an ANSI text'; Result.PropInteger := -1234; Result.PropUInt32 := 1234; diff --git a/unittests/general/Several/LiveServerTestU.pas b/unittests/general/Several/LiveServerTestU.pas index 6b902f1e..64f8cab4 100644 --- a/unittests/general/Several/LiveServerTestU.pas +++ b/unittests/general/Several/LiveServerTestU.pas @@ -72,11 +72,11 @@ type [Test] procedure TestReqWithParams; - // URL_MAPPED_PARAMS_ALLOWED_CHARS = ' ������@\[\]\{\}\(\)\=;&#\.\_\,%\w\d\x2D\x3A'; + // URL_MAPPED_PARAMS_ALLOWED_CHARS = ' àèéùòì@\[\]\{\}\(\)\=;&#\.\_\,%\w\d\x2D\x3A'; [Test] - [TestCase('1', ' �,�')] - [TestCase('2', '�,�,�')] - [TestCase('3', '�,@,[')] + [TestCase('1', ' à,è')] + [TestCase('2', 'é,ù,ò')] + [TestCase('3', 'ì,@,[')] [TestCase('4', '],{,}')] [TestCase('5', '(,),\')] [TestCase('6', '=,;,&')] @@ -1190,17 +1190,17 @@ begin lJSONObj := TSystemJSON.StringAsJSONObject(res.Content); S := lJSONObj.Get('name1').JsonValue.Value; - Assert.areEqual('j�rn', S); + Assert.areEqual('jørn', S); lJSONObj.Free; lJSONObj := TSystemJSON.StringAsJSONObject(res.Content); S := lJSONObj.Get('name3').JsonValue.Value; - Assert.areEqual('������', S); + Assert.areEqual('àèéìòù', S); lJSONObj.Free; lJSONObj := TSystemJSON.StringAsJSONObject(res.Content); S := lJSONObj.Get('name2').JsonValue.Value; - Assert.areEqual('�to je Unicode?', S, + Assert.areEqual('Što je Unicode?', S, 'If this test fail, check http://qc.embarcadero.com/wc/qcmain.aspx?d=119779'); lJSONObj.Free; { WARNING!!! } @@ -1618,7 +1618,7 @@ begin lResp := RESTClient.Get('/injectable10'); lJSON := StrToJSONObject(lResp.Content); try - Assert.areEqual('this is a string', lJSON.S['ParString'], 'wrong string'); + Assert.areEqual('this is a string', lJSON.S['ParString'], 'wrong string: ' + lJSON.ToJSON()); Assert.areEqual(1234, lJSON.I['ParInteger'], 'wrong ParInteger'); Assert.areEqual(1234567890, lJSON.L['ParInt64'], 'wrong ParInt64'); Assert.areEqual('2011-11-17', lJSON.S['ParTDate'], 'wrong ParTDate'); @@ -2152,7 +2152,7 @@ begin P := TPerson.Create; try P.FirstName := 'Daniele'; - P.LastName := '������'; + P.LastName := 'àòùèéì'; P.DOB := EncodeDate(1979, 1, 1); P.Married := true; try @@ -2179,7 +2179,7 @@ begin GetDefaultSerializer.DeserializeObject(r.Content, P); // P := Mapper.JSONObjectToObject(r.BodyAsJsonObject); Assert.areEqual('Daniele', P.FirstName); - Assert.areEqual('������', P.LastName); + Assert.areEqual('àòùèéì', P.LastName); Assert.areEqual(true, P.Married); Assert.areEqual(EncodeDate(1979, 1, 1), P.DOB); finally @@ -2195,7 +2195,7 @@ begin P := TPerson.Create; try P.FirstName := 'Daniele'; - P.LastName := '������'; + P.LastName := 'àòùèéì'; P.DOB := EncodeDate(1979, 1, 1); P.Married := true; try @@ -2220,7 +2220,7 @@ begin GetDefaultSerializer.DeserializeObject(r.Content, P); // P := Mapper.JSONObjectToObject(r.BodyAsJsonObject); Assert.areEqual('Daniele', P.FirstName); - Assert.areEqual('������', P.LastName); + Assert.areEqual('àòùèéì', P.LastName); Assert.areEqual(true, P.Married); Assert.areEqual(EncodeDate(1979, 1, 1), P.DOB); finally @@ -2306,7 +2306,7 @@ begin TEncoding.Convert( TEncoding.Default, lISO8859_1Encoding, - lISO8859_1Encoding.GetBytes('������') + lISO8859_1Encoding.GetBytes('àèéìòù') ) ); finally @@ -2315,7 +2315,7 @@ begin res := RESTClient.Accept(TMVCMediaType.TEXT_PLAIN) .Post('/testconsumes/textiso8859_1', lVal, BuildContentType(TMVCMediaType.TEXT_PLAIN, TMVCCharSet.ISO88591)); Assert.areEqual(HTTP_STATUS.OK, res.StatusCode); - // Assert.AreNotEqual('������', res.Content, 'non iso8859-1 text is rendered ok whan should not'); + // Assert.AreNotEqual('àèéìòù', res.Content, 'non iso8859-1 text is rendered ok whan should not'); SplitContentMediaTypeAndCharset(res.ContentType, lContentType, lContentCharset); Assert.areEqual(lContentType, TMVCMediaType.TEXT_PLAIN); Assert.areEqual(lContentCharset, TMVCCharSet.ISO88591); diff --git a/unittests/general/Several/Serializers.JsonDataObjectsTestU.pas b/unittests/general/Several/Serializers.JsonDataObjectsTestU.pas index 4aa8c36b..f8c3ad64 100644 --- a/unittests/general/Several/Serializers.JsonDataObjectsTestU.pas +++ b/unittests/general/Several/Serializers.JsonDataObjectsTestU.pas @@ -6,7 +6,7 @@ // // https://github.com/danieleteti/delphimvcframework // -// Collaborators with this file: Ezequiel Juliano M�ller (ezequieljuliano@gmail.com) +// Collaborators with this file: Ezequiel Juliano Müller (ezequieljuliano@gmail.com) // // *************************************************************************** // @@ -253,20 +253,20 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestDataSetHelpers; const - JSON = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano M�ller",' + '"Salary":100,' + + JSON = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano Müller",' + '"Salary":100,' + '"Birthday":"1987-10-15",' + '"AccessDateTime":"2017-02-17T16:37:50.000+01:00",' + '"AccessTime":"16:40:50",' + '"Active":true,' + '"Amount":100,' + '"BlobFld":"PGh0bWw+PGJvZHk+PGgxPkJMT0I8L2gxPjwvYm9keT48L2h0bWw+",' + - '"Items":[' + '{' + '"Id":1,' + '"Name":"Ezequiel Juliano M�ller"' + '},' + '{' + '"Id":2,' + '"Name":"Juliano"' + + '"Items":[' + '{' + '"Id":1,' + '"Name":"Ezequiel Juliano Müller"' + '},' + '{' + '"Id":2,' + '"Name":"Juliano"' + '}' + '],' + '"Departament":{' + '"Name":"Depto1"' + '},' + '"GUID":"{9386C957-5379-4370-8492-8FA464A9CF0C}"' + '}'; - JSON_LOWERCASE = '{' + '"id":1,' + '"name":"Ezequiel Juliano M�ller"' + '}'; + JSON_LOWERCASE = '{' + '"id":1,' + '"name":"Ezequiel Juliano Müller"' + '}'; - JSON_UPPERCASE = '{' + '"ID":1,' + '"NAME":"Ezequiel Juliano M�ller"' + '}'; + JSON_UPPERCASE = '{' + '"ID":1,' + '"NAME":"Ezequiel Juliano Müller"' + '}'; - JSON_ASIS = '{' + '"Id":1,' + '"Name":"Ezequiel Juliano M�ller"' + '}'; + JSON_ASIS = '{' + '"Id":1,' + '"Name":"Ezequiel Juliano Müller"' + '}'; - JSON_LIST = '[' + '{' + '"Id_Id":1,' + '"Name_Name":"Ezequiel Juliano M�ller"' + '},' + '{' + '"Id_Id":2,' + - '"Name_Name":"Ezequiel Juliano M�ller"' + '}' + ']'; + JSON_LIST = '[' + '{' + '"Id_Id":1,' + '"Name_Name":"Ezequiel Juliano Müller"' + '},' + '{' + '"Id_Id":2,' + + '"Name_Name":"Ezequiel Juliano Müller"' + '}' + ']'; var Dm: TEntitiesModule; @@ -277,7 +277,7 @@ begin Dm.Entity.Insert; Dm.EntityId.AsLargeInt := 1; Dm.EntityCode.AsInteger := 2; - Dm.EntityName.AsString := 'Ezequiel Juliano M�ller'; + Dm.EntityName.AsString := 'Ezequiel Juliano Müller'; Dm.EntityBirthday.AsDateTime := StrToDate('15/10/1987'); Dm.EntityAccessDateTime.AsDateTime := StrToDateTime('17/02/2017 16:37:50'); Dm.EntityAccessTime.AsDateTime := StrToTime('16:40:50'); @@ -289,7 +289,7 @@ begin Dm.Item.Insert; Dm.ItemId.AsLargeInt := 1; - Dm.ItemName.AsString := 'Ezequiel Juliano M�ller'; + Dm.ItemName.AsString := 'Ezequiel Juliano Müller'; Dm.Item.Post; Dm.Item.Insert; @@ -360,20 +360,20 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestDeserializeDataSet; const - JSON = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano M�ller",' + '"Salary":100,' + + JSON = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano Müller",' + '"Salary":100,' + '"Birthday":"1987-10-15",' + '"AccessDateTime":"2017-02-17 16:37:50",' + '"AccessTime":"16:40:50",' + '"Active":true,' + '"Amount":100,' + '"BlobFld":"PGh0bWw+PGJvZHk+PGgxPkJMT0I8L2gxPjwvYm9keT48L2h0bWw+",' + '"Items":[' + '{' + '"Id":1,' + '"Name":"Ezequiel"' + '},' + '{' + '"Id":2,' + '"Name":"Juliano"' + '}' + '],' + '"Departament":{' + '"Name":"Depto1"' + '},' + '"GUID":"{9386C957-5379-4370-8492-8FA464A9CF0C}"' + '}'; - JSON_LOWERCASE = '{' + '"id":1,' + '"name":"Ezequiel Juliano M�ller"' + '}'; + JSON_LOWERCASE = '{' + '"id":1,' + '"name":"Ezequiel Juliano Müller"' + '}'; - JSON_UPPERCASE = '{' + '"ID":1,' + '"NAME":"Ezequiel Juliano M�ller"' + '}'; + JSON_UPPERCASE = '{' + '"ID":1,' + '"NAME":"Ezequiel Juliano Müller"' + '}'; - JSON_ASIS = '{' + '"Id_Id":1,' + '"Name_Name":"Ezequiel Juliano M�ller"' + '}'; + JSON_ASIS = '{' + '"Id_Id":1,' + '"Name_Name":"Ezequiel Juliano Müller"' + '}'; - JSON_LIST = '[' + '{' + '"Id_Id":1,' + '"Name_Name":"Ezequiel Juliano M�ller"' + '},' + '{' + '"Id_Id":2,' + - '"Name_Name":"Ezequiel Juliano M�ller"' + '}' + ']'; + JSON_LIST = '[' + '{' + '"Id_Id":1,' + '"Name_Name":"Ezequiel Juliano Müller"' + '},' + '{' + '"Id_Id":2,' + + '"Name_Name":"Ezequiel Juliano Müller"' + '}' + ']'; JSON_ITEMS = '{' + '"items":[' + '{' + '"Id_Id":1,' + '"Name_Name":"Pedro Henrique de Oliveira"' + '},' + '{' + '"Id_Id":2,' + '"Name_Name":"Rogers Abe"' + '}' + '],' + '"meta":{"count":"2"}}'; @@ -385,7 +385,7 @@ begin fSerializer.DeserializeDataSetRecord(JSON, Dm.Entity, ['Ignored']); Assert.isTrue(Dm.EntityId.AsLargeInt = 1); Assert.isTrue(Dm.EntityCode.AsInteger = 2); - Assert.isTrue(Dm.EntityName.AsString = 'Ezequiel Juliano M�ller'); + Assert.isTrue(Dm.EntityName.AsString = 'Ezequiel Juliano Müller'); Assert.isTrue(Dm.EntityBirthday.AsDateTime = StrToDate('15/10/1987')); Assert.isTrue(Dm.EntityAccessDateTime.AsDateTime = StrToDateTime('17/02/2017 16:37:50')); Assert.isTrue(Dm.EntityAccessTime.AsDateTime = StrToTime('16:40:50')); @@ -408,29 +408,29 @@ begin fSerializer.DeserializeDataSetRecord(JSON_LOWERCASE, Dm.EntityLowerCase); Assert.isTrue(Dm.EntityLowerCaseId.AsLargeInt = 1); - Assert.isTrue(Dm.EntityLowerCaseName.AsString = 'Ezequiel Juliano M�ller'); + Assert.isTrue(Dm.EntityLowerCaseName.AsString = 'Ezequiel Juliano Müller'); fSerializer.DeserializeDataSetRecord(JSON_UPPERCASE, Dm.EntityUpperCase); Assert.isTrue(Dm.EntityUpperCaseId.AsLargeInt = 1); - Assert.isTrue(Dm.EntityUpperCaseName.AsString = 'Ezequiel Juliano M�ller'); + Assert.isTrue(Dm.EntityUpperCaseName.AsString = 'Ezequiel Juliano Müller'); fSerializer.DeserializeDataSetRecord(JSON_UPPERCASE, Dm.EntityUpperCase2, [], ncUpperCase); Assert.isTrue(Dm.EntityUpperCase2Id.AsLargeInt = 1); - Assert.isTrue(Dm.EntityUpperCase2Name.AsString = 'Ezequiel Juliano M�ller'); + Assert.isTrue(Dm.EntityUpperCase2Name.AsString = 'Ezequiel Juliano Müller'); fSerializer.DeserializeDataSetRecord(JSON_ASIS, Dm.EntityAsIs); Assert.isTrue(Dm.EntityAsIsId.AsLargeInt = 1); - Assert.isTrue(Dm.EntityAsIsName.AsString = 'Ezequiel Juliano M�ller'); + Assert.isTrue(Dm.EntityAsIsName.AsString = 'Ezequiel Juliano Müller'); Dm.EntityAsIs.EmptyDataSet; fSerializer.DeserializeDataSet(JSON_LIST, Dm.EntityAsIs); Dm.EntityAsIs.First; Assert.isTrue(Dm.EntityAsIsId.AsLargeInt = 1); - Assert.isTrue(Dm.EntityAsIsName.AsString = 'Ezequiel Juliano M�ller'); + Assert.isTrue(Dm.EntityAsIsName.AsString = 'Ezequiel Juliano Müller'); Dm.EntityAsIs.Next; Assert.isTrue(Dm.EntityAsIsId.AsLargeInt = 2); - Assert.isTrue(Dm.EntityAsIsName.AsString = 'Ezequiel Juliano M�ller'); + Assert.isTrue(Dm.EntityAsIsName.AsString = 'Ezequiel Juliano Müller'); Dm.EntityAsIs.EmptyDataSet; Dm.EntityAsIs.LoadJSONArrayFromJSONObjectProperty('items', JSON_ITEMS, ncAsIs); @@ -452,7 +452,7 @@ procedure TMVCTestSerializerJsonDataObjects.TestDeserializeEntity; begin Assert.isTrue(AEntity.Id = 1); Assert.isTrue(AEntity.Code = 2); - Assert.isTrue(AEntity.Name = 'Ezequiel Juliano M�ller'); + Assert.isTrue(AEntity.Name = 'Ezequiel Juliano Müller'); Assert.isTrue(AEntity.Salary = 100); Assert.isTrue(DateToStr(AEntity.Birthday) = '15/10/1987'); Assert.isTrue(DateTimeToStr(AEntity.AccessDateTime) = '17/02/2017 16:37:50'); @@ -473,7 +473,7 @@ procedure TMVCTestSerializerJsonDataObjects.TestDeserializeEntity; end; const - JSON_PROPERTIES = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano M�ller",' + '"Salary":100,' + + JSON_PROPERTIES = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano Müller",' + '"Salary":100,' + '"Birthday":"1987-10-15",' + '"AccessDateTime":"2017-02-17T16:37:50",' + '"AccessTime":"16:40:50",' + '"Active":true,' + '"Role":"roGuest",' + '"Teporization":63623032670000,' + '"Department":{' + '"Id":1,' + '"Name":"Development",' + '"Notes":[' + '{' + '"Description":"DepNote1"' + '},' + '{' + '"Description":"DepNote2"' + @@ -481,7 +481,7 @@ const '"Description":"EntNote2"' + '}' + '],' + '"NotesEmpty":[],' + '"AppreciationAs":"Yes",' + '"Appreciation":{' + '"type":"ustring",' + '"value":"Yes"' + '}' + '}'; - JSON_FIELDS = '{' + '"FId":1,' + '"FCode":2,' + '"FName":"Ezequiel Juliano M�ller",' + '"FSalary":100,' + + JSON_FIELDS = '{' + '"FId":1,' + '"FCode":2,' + '"FName":"Ezequiel Juliano Müller",' + '"FSalary":100,' + '"FBirthday":"1987-10-15",' + '"FAccessDateTime":"2017-02-17T16:37:50",' + '"FAccessTime":"16:40:50",' + '"FActive":true,' + '"FRole":"roGuest",' + '"FTeporization":63623032670000,' + '"FDepartment":{' + '"FId":1,' + '"FName":"Development",' + '"FNotes":[' + '{' + '"FDescription":"DepNote1"' + '},' + '{' + @@ -510,8 +510,8 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestDeserializeEntityCustomMemberSerializer; const - JSON = '{' + '"Entity":{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano M�ller"' + '},' + - '"Notes":"RXplcXVpZWwgSnVsaWFubyBN/GxsZXI=",' + '"NotesAsString":"Ezequiel Juliano M�ller"' + '}'; + JSON = '{' + '"Entity":{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano Müller"' + '},' + + '"Notes":"RXplcXVpZWwgSnVsaWFubyBN/GxsZXI=",' + '"NotesAsString":"Ezequiel Juliano Müller"' + '}'; var O: TSale; begin @@ -520,9 +520,9 @@ begin fSerializer.DeserializeObject(JSON, O); Assert.isTrue(O.Entity.Id = 1); Assert.isTrue(O.Entity.Code = 2); - Assert.isTrue(O.Entity.Name = 'Ezequiel Juliano M�ller'); - Assert.isTrue(O.Notes.DataString = 'Ezequiel Juliano M�ller'); - Assert.isTrue(O.NotesAsString.DataString = 'Ezequiel Juliano M�ller'); + Assert.isTrue(O.Entity.Name = 'Ezequiel Juliano Müller'); + Assert.isTrue(O.Notes.DataString = 'Ezequiel Juliano Müller'); + Assert.isTrue(O.NotesAsString.DataString = 'Ezequiel Juliano Müller'); finally O.Free; end; @@ -530,7 +530,7 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestDeserializeEntityCustomSerializer; const - JSON = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano M�ller"' + '}'; + JSON = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano Müller"' + '}'; var O: TEntityCustom; begin @@ -539,7 +539,7 @@ begin fSerializer.DeserializeObject(JSON, O); Assert.isTrue(O.Id = 1); Assert.isTrue(O.Code = 2); - Assert.isTrue(O.Name = 'Ezequiel Juliano M�ller'); + Assert.isTrue(O.Name = 'Ezequiel Juliano Müller'); finally O.Free; end; @@ -547,7 +547,7 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestDeserializeEntityCustomValueTypeSerializer; const - JSON = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano M�ller",' + '"NullableInteger":3' + '}'; + JSON = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano Müller",' + '"NullableInteger":3' + '}'; var O: TEntityCustomWithNullables; begin @@ -556,7 +556,7 @@ begin fSerializer.DeserializeObject(JSON, O); Assert.isTrue(O.Id = 1); Assert.isTrue(O.Code = 2); - Assert.isTrue(O.Name = 'Ezequiel Juliano M�ller'); + Assert.isTrue(O.Name = 'Ezequiel Juliano Müller'); finally O.Free; end; @@ -564,9 +564,9 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestDeserializeEntitySerializationType; const - JSON_FIELDS = '{' + '"FId":1,' + '"FCode":2,' + '"FName":"Ezequiel Juliano M�ller"' + '}'; + JSON_FIELDS = '{' + '"FId":1,' + '"FCode":2,' + '"FName":"Ezequiel Juliano Müller"' + '}'; - JSON_PROPERTIES = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano M�ller"' + '}'; + JSON_PROPERTIES = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano Müller"' + '}'; var OFields: TEntitySerializeFields; OProperties: TEntitySerializeProperties; @@ -576,7 +576,7 @@ begin fSerializer.DeserializeObject(JSON_FIELDS, OFields); Assert.isTrue(OFields.Id = 1); Assert.isTrue(OFields.Code = 2); - Assert.isTrue(OFields.Name = 'Ezequiel Juliano M�ller'); + Assert.isTrue(OFields.Name = 'Ezequiel Juliano Müller'); finally OFields.Free; end; @@ -586,7 +586,7 @@ begin fSerializer.DeserializeObject(JSON_PROPERTIES, OProperties); Assert.isTrue(OProperties.Id = 1); Assert.isTrue(OProperties.Code = 2); - Assert.isTrue(OProperties.Name = 'Ezequiel Juliano M�ller'); + Assert.isTrue(OProperties.Name = 'Ezequiel Juliano Müller'); finally OProperties.Free; end; @@ -1013,20 +1013,20 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestSerializeDataSet; const - JSON = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano M�ller",' + '"Salary":100,' + + JSON = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano Müller",' + '"Salary":100,' + '"Birthday":"1987-10-15",' + '"AccessDateTime":"2017-02-17T16:37:50.000+01:00",' + '"AccessTime":"16:40:50",' + '"Active":true,' + '"Amount":100,' + '"BlobFld":"PGh0bWw+PGJvZHk+PGgxPkJMT0I8L2gxPjwvYm9keT48L2h0bWw+",' + '"Items":[' + '{' + '"Id":1,' + '"Name":"Ezequiel"' + '},' + '{' + '"Id":2,' + '"Name":"Juliano"' + '}' + '],' + '"Departament":{' + '"Name":"Depto1"' + '},' + '"GUID":"{9386C957-5379-4370-8492-8FA464A9CF0C}"' + '}'; - JSON_LOWERCASE = '{' + '"id":1,' + '"name":"Ezequiel Juliano M�ller"' + '}'; + JSON_LOWERCASE = '{' + '"id":1,' + '"name":"Ezequiel Juliano Müller"' + '}'; - JSON_UPPERCASE = '{' + '"ID":1,' + '"NAME":"Ezequiel Juliano M�ller"' + '}'; + JSON_UPPERCASE = '{' + '"ID":1,' + '"NAME":"Ezequiel Juliano Müller"' + '}'; - JSON_ASIS = '{' + '"Id_Id":1,' + '"Name_Name":"Ezequiel Juliano M�ller"' + '}'; + JSON_ASIS = '{' + '"Id_Id":1,' + '"Name_Name":"Ezequiel Juliano Müller"' + '}'; - JSON_LIST = '[' + '{' + '"Id_Id":1,' + '"Name_Name":"Ezequiel Juliano M�ller"' + '},' + '{' + '"Id_Id":2,' + - '"Name_Name":"Ezequiel Juliano M�ller"' + '}' + ']'; + JSON_LIST = '[' + '{' + '"Id_Id":1,' + '"Name_Name":"Ezequiel Juliano Müller"' + '},' + '{' + '"Id_Id":2,' + + '"Name_Name":"Ezequiel Juliano Müller"' + '}' + ']'; var Dm: TEntitiesModule; @@ -1037,7 +1037,7 @@ begin Dm.Entity.Insert; Dm.EntityId.AsLargeInt := 1; Dm.EntityCode.AsInteger := 2; - Dm.EntityName.AsString := 'Ezequiel Juliano M�ller'; + Dm.EntityName.AsString := 'Ezequiel Juliano Müller'; Dm.EntityBirthday.AsDateTime := StrToDate('15/10/1987'); Dm.EntityAccessDateTime.AsDateTime := StrToDateTime('17/02/2017 16:37:50'); Dm.EntityAccessTime.AsDateTime := StrToTime('16:40:50'); @@ -1067,35 +1067,35 @@ begin Dm.EntityLowerCase.Insert; Dm.EntityLowerCaseId.AsLargeInt := 1; - Dm.EntityLowerCaseName.AsString := 'Ezequiel Juliano M�ller'; + Dm.EntityLowerCaseName.AsString := 'Ezequiel Juliano Müller'; Dm.EntityLowerCase.Post; S := fSerializer.SerializeDataSetRecord(Dm.EntityLowerCase); Assert.areEqual(JSON_LOWERCASE, S, False, 'json lowercase'); Dm.EntityUpperCase.Insert; Dm.EntityUpperCaseId.AsLargeInt := 1; - Dm.EntityUpperCaseName.AsString := 'Ezequiel Juliano M�ller'; + Dm.EntityUpperCaseName.AsString := 'Ezequiel Juliano Müller'; Dm.EntityUpperCase.Post; S := fSerializer.SerializeDataSetRecord(Dm.EntityUpperCase); Assert.areEqual(JSON_UPPERCASE, S, False, 'json uppercase (1)'); Dm.EntityUpperCase2.Insert; Dm.EntityUpperCase2Id.AsLargeInt := 1; - Dm.EntityUpperCase2Name.AsString := 'Ezequiel Juliano M�ller'; + Dm.EntityUpperCase2Name.AsString := 'Ezequiel Juliano Müller'; Dm.EntityUpperCase2.Post; S := fSerializer.SerializeDataSetRecord(Dm.EntityUpperCase2, [], ncUpperCase); Assert.areEqual(JSON_UPPERCASE, S, False, 'json uppercase (2)'); Dm.EntityAsIs.Insert; Dm.EntityAsIsId.AsLargeInt := 1; - Dm.EntityAsIsName.AsString := 'Ezequiel Juliano M�ller'; + Dm.EntityAsIsName.AsString := 'Ezequiel Juliano Müller'; Dm.EntityAsIs.Post; S := fSerializer.SerializeDataSetRecord(Dm.EntityAsIs); Assert.areEqual(JSON_ASIS, S, False, 'json as is'); Dm.EntityAsIs.Append; Dm.EntityAsIsId.AsLargeInt := 2; - Dm.EntityAsIsName.AsString := 'Ezequiel Juliano M�ller'; + Dm.EntityAsIsName.AsString := 'Ezequiel Juliano Müller'; Dm.EntityAsIs.Post; // serialize dataset @@ -1187,7 +1187,7 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestSerializeEntity; const - JSON_PROPERTIES = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano M�ller",' + '"Salary":100,' + + JSON_PROPERTIES = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano Müller",' + '"Salary":100,' + '"Birthday":"1987-10-15",' + '"AccessDateTime":"2017-02-17T16:37:50.000+01:00",' + '"AccessTime":"16:40:50",' + '"Active":true,' + '"Role":"roGuest",' + '"Teporization":63623032670000,' + '"Department":{' + '"Id":1,' + '"Name":"Development",' + '"Notes":[' + '{' + '"Description":"DepNote1"' + '},' + '{' + '"Description":"DepNote2"' + @@ -1195,7 +1195,7 @@ const '"Description":"EntNote2"' + '}' + '],' + '"NotesEmpty":[],' + '"AppreciationAs":"Yes",' + '"Appreciation":{' + '"type":"ustring",' + '"value":"Yes"' + '}' + '}'; - JSON_FIELDS = '{' + '"FId":1,' + '"FCode":2,' + '"FName":"Ezequiel Juliano M�ller",' + '"FSalary":100,' + + JSON_FIELDS = '{' + '"FId":1,' + '"FCode":2,' + '"FName":"Ezequiel Juliano Müller",' + '"FSalary":100,' + '"FBirthday":"1987-10-15",' + '"FAccessDateTime":"2017-02-17T16:37:50.000+01:00",' + '"FAccessTime":"16:40:50",' + '"FActive":true,' + '"FRole":"roGuest",' + '"FTeporization":63623032670000,' + '"FDepartment":{' + '"FId":1,' + '"FName":"Development",' + '"FNotes":[' + '{' + '"FDescription":"DepNote1"' + '},' + '{' + @@ -1203,7 +1203,7 @@ const '"FDescription":"EntNote1"' + '},' + '{' + '"FDescription":"EntNote2"' + '}' + '],' + '"FNotesEmpty":[],' + '"FAppreciationAs":"Yes",' + '"FAppreciation":{' + '"type":"ustring",' + '"value":"Yes"' + '}' + '}'; - JSON_NULLS = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano M�ller",' + '"Salary":100,' + + JSON_NULLS = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano Müller",' + '"Salary":100,' + '"Birthday":null,' + '"AccessDateTime":null,' + '"AccessTime":null,' + '"Active":true,' + '"Role":"roGuest",' + '"Teporization":63623032670000,' + '"Department":{' + '"Id":1,' + '"Name":"Development",' + '"Notes":[' + '{' + '"Description":"DepNote1"' + '},' + '{' + '"Description":"DepNote2"' + '}' + ']' + '},' + '"DepartmentNull":null,' + @@ -1218,7 +1218,7 @@ begin try O.Id := 1; O.Code := 2; - O.Name := 'Ezequiel Juliano M�ller'; + O.Name := 'Ezequiel Juliano Müller'; O.Salary := 100; O.Birthday := StrToDate('15/10/1987'); O.AccessDateTime := StrToDateTime('17/02/2017 16:37:50'); @@ -1255,8 +1255,8 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestSerializeEntityCustomMemberSerializer; const - JSON = '{' + '"Entity":{' + '"AId":1,' + '"ACode":2,' + '"AName":"Ezequiel Juliano M�ller"' + '},' + - '"Notes":"RXplcXVpZWwgSnVsaWFubyBN/GxsZXI=",' + '"NotesAsString":"Ezequiel Juliano M�ller"' + '}'; + JSON = '{' + '"Entity":{' + '"AId":1,' + '"ACode":2,' + '"AName":"Ezequiel Juliano Müller"' + '},' + + '"Notes":"RXplcXVpZWwgSnVsaWFubyBN/GxsZXI=",' + '"NotesAsString":"Ezequiel Juliano Müller"' + '}'; var O: TSale; S: string; @@ -1265,9 +1265,9 @@ begin try O.Entity.Id := 1; O.Entity.Code := 2; - O.Entity.Name := 'Ezequiel Juliano M�ller'; - O.Notes.WriteString('Ezequiel Juliano M�ller'); - O.NotesAsString.WriteString('Ezequiel Juliano M�ller'); + O.Entity.Name := 'Ezequiel Juliano Müller'; + O.Notes.WriteString('Ezequiel Juliano Müller'); + O.NotesAsString.WriteString('Ezequiel Juliano Müller'); S := fSerializer.SerializeObject(O); Assert.areEqual(JSON, S); @@ -1278,7 +1278,7 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestSerializeEntityCustomSerializer; const - JSON = '{' + '"AId":1,' + '"ACode":2,' + '"AName":"Ezequiel Juliano M�ller"' + '}'; + JSON = '{' + '"AId":1,' + '"ACode":2,' + '"AName":"Ezequiel Juliano Müller"' + '}'; var O: TEntityCustom; S: string; @@ -1287,7 +1287,7 @@ begin try O.Id := 1; O.Code := 2; - O.Name := 'Ezequiel Juliano M�ller'; + O.Name := 'Ezequiel Juliano Müller'; S := fSerializer.SerializeObject(O); Assert.areEqual(JSON, S); @@ -1298,7 +1298,7 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestSerializeEntityLowerCaseNames; const - JSON = '{' + '"id":1,' + '"code":2,' + '"name":"Ezequiel Juliano M�ller"' + '}'; + JSON = '{' + '"id":1,' + '"code":2,' + '"name":"Ezequiel Juliano Müller"' + '}'; var O: TEntityLowerCase; S: string; @@ -1307,7 +1307,7 @@ begin try O.Id := 1; O.Code := 2; - O.Name := 'Ezequiel Juliano M�ller'; + O.Name := 'Ezequiel Juliano Müller'; S := fSerializer.SerializeObject(O); Assert.areEqual(JSON, S); @@ -1318,7 +1318,7 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestSerializeEntityNameAs; const - JSON = '{' + '"Id_Id":1,' + '"Code_Code":2,' + '"Name_Name":"Ezequiel Juliano M�ller"' + '}'; + JSON = '{' + '"Id_Id":1,' + '"Code_Code":2,' + '"Name_Name":"Ezequiel Juliano Müller"' + '}'; var O: TEntityNameAs; S: string; @@ -1327,7 +1327,7 @@ begin try O.Id := 1; O.Code := 2; - O.Name := 'Ezequiel Juliano M�ller'; + O.Name := 'Ezequiel Juliano Müller'; S := fSerializer.SerializeObject(O); Assert.areEqual(JSON, S); @@ -1341,9 +1341,9 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestSerializeEntitySerializationType; const - JSON_FIELDS = '{' + '"FId":1,' + '"FCode":2,' + '"FName":"Ezequiel Juliano M�ller"' + '}'; + JSON_FIELDS = '{' + '"FId":1,' + '"FCode":2,' + '"FName":"Ezequiel Juliano Müller"' + '}'; - JSON_PROPERTIES = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano M�ller"' + '}'; + JSON_PROPERTIES = '{' + '"Id":1,' + '"Code":2,' + '"Name":"Ezequiel Juliano Müller"' + '}'; var OFields: TEntitySerializeFields; OProperties: TEntitySerializeProperties; @@ -1353,7 +1353,7 @@ begin try OFields.Id := 1; OFields.Code := 2; - OFields.Name := 'Ezequiel Juliano M�ller'; + OFields.Name := 'Ezequiel Juliano Müller'; S := fSerializer.SerializeObject(OFields); Assert.areEqual(JSON_FIELDS, S); @@ -1365,7 +1365,7 @@ begin try OProperties.Id := 1; OProperties.Code := 2; - OProperties.Name := 'Ezequiel Juliano M�ller'; + OProperties.Name := 'Ezequiel Juliano Müller'; S := fSerializer.SerializeObject(OProperties); Assert.areEqual(JSON_PROPERTIES, S); @@ -1376,7 +1376,7 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestSerializeEntityUpperCaseNames; const - JSON = '{' + '"ID":1,' + '"CODE":2,' + '"NAME":"Ezequiel Juliano M�ller"' + '}'; + JSON = '{' + '"ID":1,' + '"CODE":2,' + '"NAME":"Ezequiel Juliano Müller"' + '}'; var O: TEntityUpperCase; S: string; @@ -1385,7 +1385,7 @@ begin try O.Id := 1; O.Code := 2; - O.Name := 'Ezequiel Juliano M�ller'; + O.Name := 'Ezequiel Juliano Müller'; S := fSerializer.SerializeObject(O); Assert.areEqual(JSON, S); @@ -1519,7 +1519,7 @@ end; procedure TMVCTestSerializerJsonDataObjects.TestSerializeDeserializeEntityWithInterface; const - JSON = '{' + '"Id":1,' + '"Name":"Jo�o Ant�nio Duarte",' + '"ChildEntity":{' + '"Code":10,' + + JSON = '{' + '"Id":1,' + '"Name":"João Antônio Duarte",' + '"ChildEntity":{' + '"Code":10,' + '"Description":"Child Entity"' + '}' + '}'; var LEntity: IEntityWithInterface; @@ -1527,7 +1527,7 @@ var begin LEntity := TEntityWithInterface.Create; LEntity.Id := 1; - LEntity.Name := 'Jo�o Ant�nio Duarte'; + LEntity.Name := 'João Antônio Duarte'; LEntity.ChildEntity.Code := 10; LEntity.ChildEntity.Description := 'Child Entity'; @@ -1537,7 +1537,7 @@ begin LEntity := TEntityWithInterface.Create; fSerializer.DeserializeObject(LJson, LEntity); Assert.areEqual(Integer(1), LEntity.Id); - Assert.areEqual('Jo�o Ant�nio Duarte', LEntity.Name); + Assert.areEqual('João Antônio Duarte', LEntity.Name); Assert.areEqual(Integer(10), LEntity.ChildEntity.Code); Assert.areEqual('Child Entity', LEntity.ChildEntity.Description); end; @@ -1717,7 +1717,7 @@ const '"NullableGuid":"{EABA9B61-6812-4F0A-9469-D247EB2DA8F4}",' + '"NullableGuid2":"fa51caa7-7d48-46ba-bfde-34c1f740e066",' + '"Id":1,' + '"Code":2,' + - '"Name":"Jo�o Ant�nio"' + '}'; + '"Name":"João Antônio"' + '}'; var LEntity: TEntityCustomWithGuid; LJson: string; @@ -1726,7 +1726,7 @@ begin try LEntity.Id := 1; LEntity.Code := 2; - LEntity.Name := 'Jo�o Ant�nio'; + LEntity.Name := 'João Antônio'; LEntity.GuidValue := StringToGUID('{AEED1A0F-9061-40F0-9FDA-D69AE7F20222}'); LEntity.GuidValue2 := StringToGUID('{CA09DC98-85BA-46E8-ABA2-117C2FA8EF25}'); LEntity.NullableGuid := StringToGUID('{EABA9B61-6812-4F0A-9469-D247EB2DA8F4}'); @@ -1743,7 +1743,7 @@ begin fSerializer.DeserializeObject(LJson, LEntity); Assert.AreEqual(int64(1), LEntity.Id); Assert.AreEqual(Integer(2), LEntity.Code); - Assert.AreEqual('Jo�o Ant�nio', LEntity.Name); + Assert.AreEqual('João Antônio', LEntity.Name); Assert.AreEqual(StringToGUID('{AEED1A0F-9061-40F0-9FDA-D69AE7F20222}'), LEntity.GuidValue); Assert.AreEqual(StringToGUID('{CA09DC98-85BA-46E8-ABA2-117C2FA8EF25}'), LEntity.GuidValue2); Assert.AreEqual(StringToGUID('{EABA9B61-6812-4F0A-9469-D247EB2DA8F4}'), LEntity.NullableGuid.Value); diff --git a/unittests/general/TestServer/TestServerControllerU.pas b/unittests/general/TestServer/TestServerControllerU.pas index e45e0e93..d6d5edb5 100644 --- a/unittests/general/TestServer/TestServerControllerU.pas +++ b/unittests/general/TestServer/TestServerControllerU.pas @@ -927,9 +927,9 @@ begin ContentType := BuildContentType(TMVCMediaType.APPLICATION_JSON, TMVCCharset.UTF_8); Obj := TJDOJSONObject.Create; try - Obj.s['name1'] := 'j�rn'; - Obj.s['name2'] := '�to je Unicode?'; - Obj.s['name3'] := '������'; + Obj.s['name1'] := 'jørn'; + Obj.s['name2'] := 'Što je Unicode?'; + Obj.s['name3'] := 'àèéìòù'; Render(Obj, false); finally Obj.Free;