[erlang-questions] unicode in string literals

CGS <>
Tue Jul 31 14:14:18 CEST 2012


On Tue, Jul 31, 2012 at 11:45 AM, Vlad Dumitrescu <>wrote:

> On Tue, Jul 31, 2012 at 11:36 AM, CGS <> wrote:
> > There are many pros and cons for switching from Latin-1 to UTF-8 (or
> > whatever else which will nullify pretty much the understanding of byte
> > character). ...snip... I do
> > not deny some specific projects would benefit from such a character
> > encoding, but think of maintaining such a code in an international
> > environment.
>
> Also, think about having to debug a system from a remote console that
> doesn't support the right encoding (that's probably long-fetched in
> this day and age, but possible).
>
> > "-encoding()" can make quite a mess in a file. Think of an open source
> > project in which devs from different countries append their own code. You
> > will see a lot of "-encoding()" directives in a single file.
>
> My understanding was that there should be one and only one such
> directive, at the beginning of the file. I'm not even sure if there
> are any editors that can handle files with mixed encodings...
>
> > My point here is that the string manipulation should be kept apart from
> the
> > code itself and to have two modules for manipulating normal lists and
> > IO-lists (e.g., by extending unicode module). But that would be my own
> > preference.
>
> Yes, but what do you do about string literals? They are in the code...
>

I would prefer, for example, string literals to be used in debugging using
i18n library for translations from English (in the source code) instead of
getting strange characters in the log and not understanding the messages in
the source code. So, Latin-1 should be enough for that.


>
> regards,
> Vlad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120731/d9f2fd23/attachment.html>


More information about the erlang-questions mailing list