nick.tdr
nick.tdr

Reputation: 4933

Getting json parse exception

I am trying to parse json string to HashMap using json.decode(myString) but I am getting an error.

The following is my json string:

{
 'id':'5043' , 
 'artist':'Axwell Λ Ingrosso' ,
 'title':'More Than You Know' ,
 'displayName':'FDM Axwell Ingrosso.mp3' ,
 'duration':'203050',
 'path':'/storage/emulated/0/UCDownloads/FDM_Axwell_Ingrosso.mp3' 
 }

I am using jsong.decode(aboveString) to convert but I am getting the following error:

FormatException: Unexpected character (at character 2) {'id':'5043' ,'artist':'Axwell Λ Ingrosso' ,'title':'More Than You Know'

Upvotes: 0

Views: 230

Answers (1)

Maxim VA
Maxim VA

Reputation: 398

As far as i can tell, you should change all your single quotes to double quotes.

{
   'person': 'Λ'
}

The above gives me an error, however, this does not:

{
   "person": "Λ"
}

Upvotes: 1

Related Questions