Question

There is a GTK+ Javascript ( Seed ) Database Tutorial here: Javascript GTK+ Seed SqLite Tutorial

When I cut and paste the code into Geany or Gedit and compile it throws this error:

** (seed:19814): CRITICAL **: Line 3 in ./db.js: SyntaxError Invalid character '\u8220'

After unsuccessfully trying to locate and delete the offending character not once but countless times I gave up. Then I simply typed all the code into Geany and then it compiles and executes no errors .

My question is do we have a way for Geany or Gedit to actually display or even place mark such invisible characters as typing in small programs I have no issues with but as they become larger then it becomes exceedingly weary and inefficient, especially when one is trying to learn a new framework.

My apologies if this is not a proper question for Stackoverflow but I truly am trying to understand how the cutting and pasting process adds in these characters, I have looked through the html and I see no such character in the tutorial.

The whole point of having sample code is to allow the end-user to cut and paste and compile and learn ? But this gave me a real bad headache till I finally decided to type it all in and then everything works.

Was it helpful?

Solution

Your editors are displaying the offending character, you're just not recognizing it. The code point in the error message refers to the left double quotation mark character, which is indeed present in some examples on the linked page. This is almost certainly an unintentional effect of some well-meaning text editing software. As you correctly point out, code examples are intended to be copied and pasted, and you should report a bug to the site admins.

To add to the confusion, the error message printed by Seed's JavaScript parser is wrong: it misrepresents the \u201c character (which has decimal code 8220) as \u8220. This is why attempts to search for \u8220 fail.

To fix the problem in your file, you need to replace the character with an upright quotation mark. To search for an arbitrary Unicode character in a GTK-based text editor, press ctrl-f to initiate search and input the character by with ctrl-shift-u followed by the code point, in this case 201c. You will need to do the same for the right quotation mark, whose hex code is 201d.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top