%% The file encoding must be UTF-8
destroy_rooms_file(Filename) ->
- {ok, F} = file:open(Filename, [read, binary]),
+ {ok, F} = file:open(Filename, [read]),
RJID = read_room(F),
Rooms = read_rooms(F, RJID, []),
file:close(F),
eof -> eof;
String ->
case io_lib:fread("~s", String) of
- {ok, [RoomJID], _} -> split_roomjid(RoomJID);
+ {ok, [RoomJID], _} -> split_roomjid(list_to_binary(RoomJID));
{error, What} ->
io:format("Parse error: what: ~p~non the line: ~p~n~n", [What, String])
end
%%----------------------------
create_rooms_file(Filename) ->
- {ok, F} = file:open(Filename, [read, binary]),
+ {ok, F} = file:open(Filename, [read]),
RJID = read_room(F),
Rooms = read_rooms(F, RJID, []),
file:close(F),