1

I have a little problem with my JsonStream in C#

I am reading a Json Blob in my Storage with this inside:

{"id":"275177", "fremdwort":"1.FFC-Frankfurt", "ipa":"ʹeːɐ̯stɐ ɛf ɛf ʦeː ʹfraŋkfʊrt"}

in C#:

 while (Jsonreader.Read())
                        { if (Jsonreader.TokenType == JsonToken.StartObject)
                            {
                                var record = serializer.Deserialize<JsonClass>(Jsonreader);
                                log.LogInformation(record.Id.ToString() +" , "+ record.Fremdwort +" , "+ record.Ipa);

If I log my JsonStreamer I receive this:

[2021-03-04T13:30:51.367Z] 275177 , 1.FFC-Frankfurt , ´e???st? ?f ?f ?e? ´fra?kf?rt

I am missing something to encode this questionmarks, What would be the solution to receive the right string without the ???.

Thank you stranger !

smotorious
  • 45
  • 4
  • 1
    Where did you see the `??` ? These appear only when trying to read *non-Unicode* strings using the wrong codepage, or trying to display text in a console using the wrong codepage. NET strings are Unicode, so the problem is either the original blog or the way you display the output – Panagiotis Kanavos Mar 04 '21 at 14:24
  • BTW theres' no if or but about this. This question proves it: StackOverflow is a .NET application. If there was a problem with Unicode, your own question would be mangled. – Panagiotis Kanavos Mar 04 '21 at 14:26
  • @PanagiotisKanavos heyhey, I am seeing the ?? in the debug console. So it means only the console cant display it but the symbols are right the reader? – smotorious Mar 04 '21 at 14:54

1 Answers1

0

I don't think it is a serious problem. I test it in my side, and the mess code ??? only occur when we run the function in Visual Studio in local. And it just shows in logs. If we output it in responseMessage(like below screenshot), it will not show ??? in output.

enter image description here

enter image description here

And if we run the function on azure portal, it also will not show mess code ???. No matter in logs or in output. enter image description here

So we do not need to worry about that, the mess code ??? show in local logs may caused by coding problem of logs console.

Hury Shen
  • 14,948
  • 1
  • 9
  • 18
  • Heyhey thank you for the Effort :) , yeah I wrote the rows into a Table Storage and everything was fine in the end. Just a problem with the console in vs. – smotorious Mar 07 '21 at 07:29