epgsql icon indicating copy to clipboard operation
epgsql copied to clipboard

Unicode support

Open josemic opened this issue 12 years ago • 0 comments

I managed to get partially unicode read support with Erlang 16B: By changing the file 'pgsql_wire.erl' as following using the io_lib:format statement:

decode_data([C | T], <<Len:?int32, Value:Len/binary, Rest/binary>>, Acc) ->
    case C of
        #column{type = Type, format = 1}   -> Value2 = pgsql_binary:decode(Type, Value);
        #column{}                          -> 
        Value2 = io_lib:format("~ts",[Value]),  
    end,
    decode_data(T, Rest, [Value2 | Acc]).

For my table it worked, I am not sure if there are any drawbacks.

josemic avatar Jun 16 '13 16:06 josemic