what is the encoding method of the attachment path in zotero sqlite database?

Hi,
I want to write a front-end of zotero with gtk+ interface, which will use the zotero database to display the personal documents, and get a problem now: if the attachment path's encoding is English(ascii), it is no problem; but if the encoding is Chinese (UTF-8), it is could not parse the path in sqlite3 client, just echo some strange characters. The attachment is a soft link of pdf file, and in the itemAttachments table, the charsetID is null.
So what is the encoding method of the attachment path?
  • It's better to post technical questions like this to zotero-dev, but the answer is that it's the output of nsIFile.getRelativeDescriptor(), which is an "opaque, cross platform format". So using it from outside Zotero may be tricky.
  • And since what you're doing sounds an awful like the Gnotero project, you might want to search for it and work from that starting point. It works quite nicely already.
  • The first goal of my project is to organize a "reading list" with friendly ways, organize the items like gnome nautilus with note/category/tag support, for e.g., to write a thesis, organize some reference journal papers/books to read and should be referenced.
    I have used the gnotero project, and I do not think the project can do what I need.
  • That sounds great! I certainly hope that you make progress on this project, and I would be glad to do testing of it when you need it.
  • Dan, could you give me some hints about how to decode the nsIFile.getRelativeDescriptor()?
  • Read the Mozilla source?
  • Just find the source code : http://firefox.sourcearchive.com/documentation/3.6plus-pnobinonly-0ubuntu6/nsLocalFileCommon_8cpp-source.html
    but I could not understand what the code is doing.

    And I have tested that the path saved in the sqlite db, is not utf8, nor utf16.

    Could somebody kindly tell what is the meaning of the code (nsIFile.getRelativeDescriptor) ?
  • you might be better of asking this on a mozilla dev forum - more people with expertise on such things over there.
Sign In or Register to comment.