2

My device send data on eventhub using Encoding.UTF8 in c++ language.My receiver is written in c# .While receiving data from Eventhub (string body = Encoding.UTF8.GetString(message.GetBytes());) comma is replaced with %2c

  • My eventhub message is DeviceID,Temprature,Humidity\nfdf5d821-c490-4405-b84c-171b478666d1,55,65

  • but string return in c# is

    DeviceID%2CTemprature%2CHumidity%0Afdf5d821%2Dc490%2D4405%2Db84c%2D171b478 666d1%2C55%2C65

  • My first Question is how to receive data as it is as i send to eventhub without special character in c#
  • When Stream analytic run so it read the data from eventhub or not?
Abhinav Sharma
  • 299
  • 1
  • 8
  • 20
  • This is not about UTF8, but it´s URL encoded (at least something similar). http://stackoverflow.com/questions/1405048/how-do-i-decode-a-url-parameter-using-c – deviantfan Jul 10 '15 at 12:10

1 Answers1

2

You can decode url by using HttpServerUtility.UrlDecode or HttpUtility.UrlDecode

for example

string decodedUrl = HttpUtility.UrlDecode(url)
Vikas Rana
  • 1,961
  • 2
  • 32
  • 49