Json Data Source prossible encoding error


(Waddy707) #1

Hi,

  I'm trying to get the JSON data source to work using my working REST Resource JS asset which is return valid json from our 3rd part course databse REST module. (Screen captures of Json Data Souce Details Screen & Data Source View Json Data Screen attached)

 

I'm getting the following error

  MySource Warning

							File:
						
							[SYSTEM_ROOT]/packages/data/data_source_json/data_source_json.inc
						
							Line:
						
							287
					
							Message:
						
							Control character error, possibly incorrectly encoded: EBS4 Programme Details (Id: #134299)
					
							Backtrace:
						
							 
					
	<p>&#160;<p>&#160;<p>The stack trace file is attached.<p>&#160;<p>In addition to trouble shooting, I'm not sure about the json attributes setup in details screen, I assume just input the json key fields in the "Json Data Attributes" and the top level object e.g. "ProgrammesByProgrammeArea" &#160;as the "json root object" input field's, and JDS will then loop through the array and create the datasouce shadow assets?<p>&#160;<p>Regards,<p>&#160;<p>Synfield

json.txt (21.3 KB)
stack_trace.txt (57.6 KB)
json_data_source_details_scrn.pdf (42.2 KB)
json_data_source_view_json_data_scrn.pdf (31 KB)


(Waddy707) #2

Actually, I've had a look at the json output and checked validation using JSONLint online, it returns an error

 

Parse error on line 60: ...ENTRY_REQUIEMENTS": "Applicants must hav
-----------------------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['

 

But this appears to be ok, to me? Am I missing something?


(Waddy707) #3

I've found the problem, as far as validation goes we have an indigenous Maori language which uses macrons, which are used in an english context, so the word Maori should be written as M&#257;ori,  however the source encoding from REST API server has not interpreted it properly causing a parsing error.

 

I imagine once this is corrected, that we should be could to go in getting the JSON data source to work!


(Bart Banda) #4

Sounds like that it it, let us know if correcting that fixes the problem. 


(Waddy707) #5

My guess was that the REST server was encoding the data as 'ISO-8859-1', the matrix system encoding & design asset is utf-8, so setting the 'Covert to UTF-8' in the 'REST Resourse JS' and setting the 'document encoding' to 'ISO-8859-1' , got the  JSON Data Source to list out the data set records, all good!