3

私は数学の演習データベースを構築しています.couchDBを使用して演習をjson形式で保存したいので、各演習でメタデータを保存できます.

すべての Latex 構文で有効な json を使用するのに問題があります。この問題に取り組む良い方法は何でしょうか? ラテックスをエンコードすることを考えましたが、特にモバイルデバイスでデコードする必要がある場合、それが良い考えかどうかはわかりません...

データの例:

     {"taglist": null,
     "flagcount": null,
     "category": "Algebre",
     "chapter": "Polynomes",
     "difficulty": 1,
     "viewcount": null,
     "hint": null,
     "question": "Soit $P \in \mathbb{R}[X]$ scindé sur $\mathbb{R}$.\\ \begin{enumerate} \item Montrer que $P'$ est aussi scindé sur $\mathbb{R}$. \item Montrer que les racines multiples de $P'$ sont aussi racines de $P$. \item Ce resultat reste-t-il valable dans $\mathbb{C}[X]$ ? \end{enumerate}"
     "solution": null}

Moreover, as I might need to encrypt the "solution" because I do no want it to be accessed without permission, maybe I should store only the encrypted form in the json?

Or maybe the solution is to store the latex another way... ? I am very new to this kind of problem, I appreciate any help ;).

Thanks

4

2 に答える 2

4

JSON 文字列では、バックスラッシュ文字\には特別な意味があります。データに保存する場合は、\\バックスラッシュをエスケープして使用します。JSON パーサーはそれを単一のものに戻し、Couch は"$\\mathbb{R}$.\\\\"として保存する必要があり$\mathbb{R}$.\\ます。

于 2013-05-15T12:10:08.183 に答える