[erlang-questions] unicode in string literals

Michel Rijnders g.a.c.rijnders@REDACTED
Tue Jul 31 09:00:16 CEST 2012


On Tue, Jul 31, 2012 at 1:41 AM, Michael Truog <mjtruog@REDACTED> wrote:
> On 07/30/2012 03:44 PM, Richard O'Keefe wrote:
>> The thing that puzzles me about Erlang assuming that source files are in
>> Latin 1 is that I have a tokenizer for Erlang that assumes Latin 1 and
>> in every Erlang/OTP release I've checked there has been at least one
>> file it tripped up on because of UTF-8 characters.
>>
>> When can we expect -encoding('whatever'). to be supported?
>
> The solution with the way things are currently, is just to use modelines (within the first 3 lines of the file) which are supported in your favorite editor, vi or emacs:
> % -*- coding: utf-8; Mode: erlang; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
> % ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8:
>

Shouldn't that modeline read:
% -*- coding: latin-1; mode: erlang; tab-width: 4; c-basic-offset: 4;
indent-tabs-mode: nil -*-

Since the compiler assumes source files are in Latin 1?

> You just need to make sure modeline support is turned on (vim seems to default modeline support to off).
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-- 
My other car is a cdr.



More information about the erlang-questions mailing list