0

I am getting this strange ? sign in my JSON file after parsing, I am not sure how and where its coming from. The excel csv that gets parsed does not seem to have anything like that in it. See picture below.. top is parsed JSON and below is csv file columns mentioned. Its for encounter date column.

Anyone know what could be forming this and what is it called? I cant even copy and paste it.

enter image description here

------------update two--------- enter image description here

Sarah
  • 1,199
  • 2
  • 21
  • 42
  • "*The excel csv that gets parsed does not seem to have anything like that in it*" nothing *visible* doesn't mean there is *nothing*. Try going to View -> Show Symbol -> Show All Characters in Notepad++. I suspect what you have there is a Byte Order Mark (BOM) character. – VLAZ Sep 30 '20 at 18:41
  • @VLAZ thanks, am checking.. – Sarah Sep 30 '20 at 18:45
  • Nothing I am seeing, posted is screen shot under update two. – Sarah Sep 30 '20 at 18:49
  • Ah, apparently Notepad++ doesn't show BOM characters. that Show All Characters is just for whitespace. I'd like to claim false advertising. You'd have to go to Encoding and check there - it's likely UTF-8 BOM (you can also see it in the bottom right). If that's the case, you can probably use the Convert To UTF-8 option in that menu. – VLAZ Sep 30 '20 at 18:54
  • ok checking, thank you so much.. I will respond soon. – Sarah Sep 30 '20 at 18:57
  • yep UTF-8 Bom is checked and still view is like update 2 – Sarah Sep 30 '20 at 19:02
  • Yep, I expected Notepad++ to actually show that character but Show All Characters doesn't do it. As I said, false advertising. Use Encoding -> Convert to UTF-8 and then save the file. This will get rid of the BOM at the start. That will remove the character. [Here is Wikipedia on BOM](https://en.wikipedia.org/wiki/Byte_order_mark). Excel seems to use it for some reason I'm not exactly aware of. Whatever it is, so far been the only time I've had to deal with BOMs has been Excel. Sometimes you get documents *from* Excel that start with BOM, other times code has to *add* BOM *for* Excel. – VLAZ Sep 30 '20 at 19:09
  • Oh sorry i didnt get that I need to save it as UTF-8.. Doing that now.. How will I know that its removed though? – Sarah Sep 30 '20 at 19:16
  • If you try to process that file again, you shouldn't get that weird character in JS. If the encoding says UTF-8 and **not** UTF-8 BOM, then it doesn't have the BOM at the start. Some editors should be able to show it as well but I can't think of which ones those are off the top of my head. There are also some more specialised tools that examine the file contents and encoding for that but I also can't think of any right now. On Linux/Unix systems it's easier to check using `grep -rl $'\xEF\xBB\xBF' from the terminal - that's usually my approach. – VLAZ Sep 30 '20 at 19:32

0 Answers0