在 couchdb 中创建文档会产生以下错误,
12> ADoc.
[{<<"Adress">>,<<"Hjalmar Brantingsgatan 7 C">>},
{<<"District">>,<<"Brämaregården">>},
{<<"Rent">>,3964},
{<<"Rooms">>,2},
{<<"Area">>,0}]
13> IDoc.
[{<<"Adress">>,<<"Segeparksgatan 2A">>},
{<<"District">>,<<"Kirseberg">>},
{<<"Rent">>,9701},
{<<"Rooms">>,3},
{<<"Area">>,83}]
14> erlang_couchdb:create_document({"127.0.0.1", 5984}, "proto_v1", IDoc).
{json,{struct,[{<<"ok">>,true},
{<<"id">>,<<"c6d96b5f923f50bfb9263638d4167b1e">>},
{<<"rev">>,<<"1-0d17a3416d50129328f632fd5cfa1d90">>}]}}
15> erlang_couchdb:create_document({"127.0.0.1", 5984}, "proto_v1", ADoc).
** exception exit: {ucs,{bad_utf8_character_code}}
in function xmerl_ucs:from_utf8/1 (xmerl_ucs.erl, line 185)
in call from mochijson2:json_encode_string/2 (/Users/admin/AlphaGroup/src/mochijson2.erl, line 200)
in call from mochijson2:'-json_encode_proplist/2-fun-0-'/3 (/Users/admin/AlphaGroup/src/mochijson2.erl, line 181)
in call from lists:foldl/3 (lists.erl, line 1197)
in call from mochijson2:json_encode_proplist/2 (/Users/admin/AlphaGroup/src/mochijson2.erl, line 184)
in call from erlang_couchdb:create_document/3 (/Users/admin/AlphaGroup/src/erlang_couchdb.erl, line 256)
以上两个文档中的一个可以在 couchdb 中毫无问题地创建(IDoc)。
任何人都可以帮助我找出造成它的原因吗?