extended ASCII characters problem /localized !

Please report bugs here. If you are unsure whether something is a bug or an expected behavior, please post it on the "Technical Support" forum instead, and wait for a moderator to handle/move the post.
Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

extended ASCII characters problem /localized !

Postby Sesztak » Wed Jul 13, 2016 5:14 am

Dear JS-Support !

In the meantime we tried to find an WCF independent solution to extended ASCII characters problem:
(like 'öüóőúéáűí ÖÜÓŐÚÉÁŰÍ')

simply not to USE WCF (use your WebSockets Extension, we have written our WebSocket mini server, pluss using manual serialization/deserialization: XmlSerializer or json ).

Our result: the problem BEFORE any serialization, and probably Not related to WCF,
at least have have got Exception immediately after if we try to initialize any Class with extended ASCII characters :
-in the name of Class (e.g. TéstClássWithExtendedASCIIchars),
-or in the name of any Property (e.g. GetNameOfRésumé)

(fields, methodes and events not tested, but I have a bet)

(obviously, the exception at object initialization is before any other later operation with such as serialization of the object or sending to server)

Exception from Chrome : Unhandled exception JSIL.Core.js?20167131440 line 10477
Uncaught Error: Memoized value is undefined

see the following simple object initialization example:
Kassza_WCFServiceLib.TéstClássWithExtendedASCIIchars _TéstClássWithExtendedASCIIchars =
new Kassza_WCFServiceLib.TéstClássWithExtendedASCIIchars()
{
GetNameOfRésumé = "Resume Peter no extended ascii chars",
GetNumbersOfPokémon = 14,
SomeTestProperty = -13,
ChildrenList = new List<Kassza_WCFServiceLib.TéstClássWithExtendedASCIIchars>()

};

For the full class definition please, see in the attached zip file: TéstClássWithExtendedASCIIchars.cs

I hope this help to you to fix the bug easier / and sooner !

Waiting for your kind reply,
Best Regards,
Péter
Attachments
TéstClássWithExtendedASCIIchars.zip
(529 Bytes) Downloaded 448 times

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: extended ASCII characters problem /localized !

Postby Sesztak » Wed Jul 13, 2016 5:17 am

Sorry, forget to mention:
everthing is perfect with Simulator, problem only with in-browser test.

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: extended ASCII characters problem /localized !

Postby JS-Support @Userware » Wed Jul 13, 2016 10:47 am

Hi Péter,

Thank you for the message.

The issue appears to be located in the JSIL libraries. JSIL is the open-source transpiler used by CSHTML5 to convert from Intermediate Language (IL) to JavaScript.

You can either wait a few days for us to further look into the issue, or you can start looking into it on your side in order to accelerate the resolution.

Here is some information in case you want to start looking into the issue on your side.

The libraries of JSIL are located in the following directory:
C:\Program Files (x86)\MSBuild\CSharpXamlForHtml5\InternalStuff\Libraries

Those files get copied to the "bin\Debug\Output\Libraries" folder when you compile your app.

The files involved in the serialization/encoding are "JSIL.XML.js" and "JSIL.Bootstrap.Text.js".

You will find some tips for debugging JS under Chrome at the following URL:
http://forums.cshtml5.com/viewtopic.php?f=2&t=165

Again, we are also going to further look into the issue on our side in the coming days.

Thanks again,
Regards,
JS-Support

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: extended ASCII characters problem /localized !

Postby Sesztak » Wed Jul 13, 2016 11:43 am

Daer JS-Support,

Thanks for your kind help, but unfortunately we have no any knowledge or experience with JavaScript programming and
the JSIL is a huge project.

So, our only chance is : waiting for your kind solution.

(sorry, but this task to modify JSIL is simple to much for us as we are very begginer for JS).

Hurry up, please, !!! :)

Thanks in advance,
Péter

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: extended ASCII characters problem /localized !

Postby Sesztak » Thu Jul 14, 2016 1:10 am

Dear JS-Support !

One more finding related to extended ASCII characters in C# source code:

-even if you just put a class with extended ASCII characters in C# source code in your CSHTML5 project
AND you never use it (!!!) -I mean never initialize an object of such a type- you will get problem in browser:

e.g. : if you put the following class in the TéstClássWithExtendedASCIIchars.cs source in your CSHTML5 project and you uncomment the lines: your client will not be able to communicate with WCF server: "Error: Memoized value is undefined" exception.

//namespace Kassza_WCFServiceLib
//{
// [Serializable()]
// [DataContract(IsReference = true)]
// public class TéstClássWithExtendedASCIIchars
// {
// [DataMember]
// public int SomeTestProperty { get; set; }

// [DataMember]
// public int GetNumbersOfPokémon { get; set; }


// [DataMember]
// public string GetNameOfRésumé { get; set; }


// // self reference test :
// [DataMember]
// public List<TéstClássWithExtendedASCIIchars> ChildrenList { get; set; }
// }
//}


Let me emphasize: even if this source is exist (in uncommented state) without any references (means not used any other places in your code) you will got the problem ! (e.g. all other WCF methodes will be broken)

I hope this help to JS Support Team to fix the bug.

Thanks for your kind reply in advance,
Best Regards,
Péter

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: extended ASCII characters problem /localized !

Postby JS-Support @Userware » Fri Jul 15, 2016 2:06 am

Thank you Péter. Yes, it is very strange indeed. We are still investigating.
Regards
JS-Support

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: extended ASCII characters problem /localized !

Postby JS-Support @Userware » Mon Jul 18, 2016 1:08 am

Hi Péter,

Here is an update on the research.

It appears that the compiler generates the character \x instead of $

Could you please try the following:

1. Go to the "bin\Debug\Output" folder.

2. Locate the file named YOURAPPLICATIONAME.js, where "YOURAPPLICATIONAME" is the name of your main project.

3. Open that file and do a "Find and Replace" of \x and replace it with $

4. Test your application in the browser by launching "Index.html". The problem is supposed to be fixed. If not, please let me know.

If this works fine, we are going to patch the compiler so that you no longer need to do that manually.

Thank you.

Regards,
JS-Support

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: extended ASCII characters problem /localized !

Postby Sesztak » Mon Jul 18, 2016 4:30 am

dear JS-Support,

We have done what you advised, please, find our results as follows:

just for your kind information:
-1st problem -I do not know if that will be a problem or not in the future BUT definitely problem with manual replace case:
even if we not using any extended ASCII characters in type names (Class and Property names) we have found a several hundreds '\x' in our YOURAPPLICATIONAME.js file:
why ? because we use a lot of extended ASCII characters in the Content of Buttons, TextBlocks, in Headers of TabItems etc.
Generally speaking in the 'Text' part of UI Controls
For e.g.: <TabItem Header="Tranzakciók">

So, if we change all '\x' to '$' in our YOURAPPLICATIONAME.js file we got scambled texts in the UI,
for example: 'Tranzakciók' change to 'Tranzakci$f3k'

Please, confirm, that your bugfix will not modify the UI part of texts (like button Content).


-2nd problem: if make a test class at WCF Server + an interface and an methode implementation using this type:
[Serializable()]
[DataContract(IsReference = true)]
public class TéstClássWithExtendedASCIIchars
{
[DataMember]
public int SomeTestProperty { get; set; }

[DataMember]
public int GetNumbersOfPokémon { get; set; }


[DataMember]
public string GetNameOfRésumé { get; set; }


// self reference test :
[DataMember]
public List<TéstClássWithExtendedASCIIchars> ChildrenList { get; set; }
}

interface:
[OperationContract]
TéstClássWithExtendedASCIIchars TestMetodWithCustomTypesWithExtenedASCIIcharsInName(TéstClássWithExtendedASCIIchars parameter);

implementation:
public TéstClássWithExtendedASCIIchars TestMetodWithCustomTypesWithExtenedASCIIcharsInName(TéstClássWithExtendedASCIIchars parameter)
{
return new TéstClássWithExtendedASCIIchars() { SomeTestProperty = parameter.SomeTestProperty + 1 };
}

+Update the WCF ServiceReference at Client side, rebuild the project,
+change all '\x' to '$' in our YOURAPPLICATIONAME.js
+host the web page + WCF service in IIS 10.

We have got client side exception at CSHTML5 in client side browser when we try to call the function using this type:
"System.ServiceModel.FaultException: Hiba a(z) „TestMetodWithCustomTypesWithExtenedASCIIcharsInName” művelet kérelemüzenet-törzsének deszerializálása során.", something like in English: FaultException during deserialization of request message body.


-3rd case: Last, but not least some very good news:
if we try to initialize the object of extended ascii chars in type and props name:
it works if we change all '\x' to '$' in our YOURAPPLICATIONAME.js file as you advised.

Let me emphasize:
--3a: object initialization: works,
--3b: object xml serialization (with the purpose to send to server): works only in Simulator as '\x' to '$' change destroy the serialized XML format,
--3c: webSocketService1.Send(serializedXML); works correctly only in Simulator az serializedXML string content will be destroyed because of above mentioned point 3b.
--I have no idea / I have no clue what is the meaning of '\x' and '$' in JavaScript.

Sample client side related source codes:
object initialization -ok !:
Kassza_WCFServiceLib.TéstClássWithExtendedASCIIchars _TéstClássWithExtendedASCIIchars =
new Kassza_WCFServiceLib.TéstClássWithExtendedASCIIchars()
{
GetNameOfRésumé = "Résumé Péter öüóőúéáűí", // GetNameOfRésumé = "Résumé Péter öüóőúéáűí", "Resume Peter no extended ascii chars"
GetNumbersOfPokémon = 14,
SomeTestProperty = -13,

ChildrenList = new List<Kassza_WCFServiceLib.TéstClássWithExtendedASCIIchars>()
{ new Kassza_WCFServiceLib.TéstClássWithExtendedASCIIchars() {
ChildrenList =null,
GetNameOfRésumé="Subé Béatrice",
GetNumbersOfPokémon =7,
SomeTestProperty= -6} }

};

object xml serialization: ok only in Simulator ! :
string serializedXML = KasszaWEB_Kliens.XmlSerialization.Serialize(_TéstClássWithExtendedASCIIchars);

websocket send: ok only in Simulator !:
webSocketService1.Send(serializedXML);


So, to summarize 1-3 point:
S1./ if you plan to change ALL chars from '\x' to '$' simply: very bad result: it has more disadvantages, than benefits.
If you plan to change ONLY in Class, Property names AND leave other label like titles like button-textbox Content, tabitem headers untouched: it should be ok.

S2./ WCF related deserialization problem: I do not know it is coming from the type mismatch of Server - Client object versions (because we changed / modified the client object version) or not,
all what we did: warn to you the present state.

S3./, WebSocket based solution: I hope accoding S1 point it will work.

Waiting for your kind reply or if you have any question, just mention.

I hope it helps,

Best Regards,
Péter

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: extended ASCII characters problem /localized !

Postby JS-Support @Userware » Sun Jul 24, 2016 11:39 am

Hi,

We have looked into the problem but adding support for class names or method names with non-ascii characters requires more time. It will not make it for beta 9.0, which is expected in the coming days. We are going to keep working on this issue. I will keep you updated.

Thank you.
Regards,
JS-Support


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 26 guests

 

 

cron