Getting invalid string when port.ReadExisting()

Jun 13, 2011 at 1:40 PM

Hi have tried this but when I read the data from the com port port.readExisting() then it gave me the folowing output when I see in the debug Plesae help me out on this problem. Why getting this type of string from the GPS - "?\0x??x?x?x\0x?`x??x??x??\0x?x?`x?x?x?x?x?x?x?x?x?xxf~x?x??`x`\0?~??f??x?x?xx??x??xx?xxx???x?x?\0x??\0xx?x??\0xx??\0xx??xx?x?x??fxx?\0x??\0x?x??xx??~xx????`x`\0?????xx\0xxx?\0xxx??xx\0x?x?xxxx??????\0xxxx?`xxx?x?f?\0x?x?x?xx?x?\0x?x?xx\0xx?x?????`fxx???`x`\0?~?`?xx\0xx?x?\0xxx?xx\0x?x?xxxx??????\0xxxx?`xxxx?f?x?\0x?x?~x?x?xx??x???????fx???x?????x??x?\0xxxxfxxx????`x`\0?~???\0??x?\0xx?\0x??x?x?xx?x?????????????????x?`x?~x?x?`x?xfx???`x`\0?????xx\0xx?x?\0xxx??xx\0x?x?xxxx??????\0xxxx?`xxxx?f?\0x?`x?x??x?x??x??xx\0xx?x?????`ffx?x??"

Thanks,

Coordinator
Jun 16, 2011 at 3:21 PM

Hi tusharmaru,

sorry for the delay. I am very busy with my paid job at the moment.

This looks like an encoding-problem. Maybe your system's locale is set to something that is not using unicode? This is just a guess. The GPS gives you bytes of data and your computer tries to display them correctly assuming you are using en-US locale. Maybe you can try to enforce using that locale like that?

gpsString = YOURBYTES.ToString(new CultureInfo("en-US");

Hope this helps.

 

Regards,

Paul