Strings (was: Re: are Mnesia tables immutable?)

Thomas Lindgren thomasl_erlang@REDACTED
Wed Jun 28 12:34:57 CEST 2006



--- Romain Lenglet
<rlenglet@REDACTED> wrote:

> I have been thinking about another solution,
> completely 
> compatible with existing code:
> 
> Let's define a few new BIFs: 
> set_default_string_external_encoding/1, 
> get_default_string_external_encoding/0 and 
> get_available_string_external_encodings/0.
> These may manipulate the default encoding of strings
> for the 
> whole Erlang node, which can be chosen among the
> list returned 
> by get_available_string_external_encodings/0, e.g. 
> ['utf-8', 'iso-8859-1', 'tis-620', ...].
> 
> That default encoding could also be specified on
> erl's command 
> line, or determined from the environment (e.g.
> environment 
> variable LC_CTYPE on Unixes).

Persistent data (e.g., mnesia) will also need to play
nice with different encodings. 

I'm not sure how generic databases handle this, but
for dets, perhaps one could (persistently) set the
encoding for the table. (Clients could then invoke the
appropriate term_to_binary and binary_to_term as part
of insert/lookup/...)

Best,
Thomas


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the erlang-questions mailing list