[erlang-questions] correct terminology for referring to strings

Thomas Lindgren thomasl_erlang@REDACTED
Thu Aug 2 14:05:41 CEST 2012



It might well be a wooly-headed idea when you look at the details, and I confess to not being an expert in this area. The basic concept would be to warn when, for instance, you've entered your string literals in Latin-1 when the compiler or system options decree that you should use UTF8. I like the overall idea of not leaving encoding problems to the good will of external tools, but if it can't be detected reliably, then it's of course just dreaming. 

Another approach might be to use a heuristic tool a la xref to detect "suspicious" string literals. Not sure if that helps.

Best,
Thomas


----- Original Message -----
> From: Richard O'Keefe <ok@REDACTED>
> To: Thomas Lindgren <thomasl_erlang@REDACTED>
> Cc: "erlang-questions@REDACTED" <erlang-questions@REDACTED>
> Sent: Thursday, August 2, 2012 3:28 AM
> Subject: Re: [erlang-questions] correct terminology for referring to strings
> 
> 
> On 2/08/2012, at 6:42 AM, Thomas Lindgren wrote:
>> 
>>  How about adding compiler warnings about string literals that do not obey
>>  the designated encoding? (There should then, of course, be multiple 
> possibilities to choose from.)
>> 
> 
> What does this actually mean?
> 
> There is no byte sequence valid in UTF-8 that is not also
> valid in Latin-1.  Yes, codes 128..159 are control characters,
> but nobody ever said that control characters weren't legal in
> strings.  Checking the mappings that came with Unicode 4,
> there is no byte sequence valid in UTF-8 that is not also
> valid in ISO 8859-{1,2,4,5,9,10,13,14,15}, PC code pages
> 437, 737, 775, 850, 852, 885, 86[012356], and Apple Arabic,
> Central European, Croatian, Cyrillic, Farsi, Greek, Hebrew,
> Icelandic, Roman, Romanian, Squeak, and Turkish.
> 
> So I have no idea what "string literals that do not obey
> the designated encoding" means or how to operationalise it.
>




More information about the erlang-questions mailing list