Boost logo

Boost :

Subject: Re: [boost] [General] Always treat std::strings as UTF-8
From: Alexander Lamaison (awl03_at_[hidden])
Date: 2011-01-17 06:14:26


On Sun, 16 Jan 2011 21:41:25 -0500, Chad Nelson wrote:

> On Sun, 16 Jan 2011 12:56:23 -0800 (PST)
> Artyom <artyomtnk_at_[hidden]> wrote:
>
>>> The system I'm now using for my programs might interest you.
>>>
>>> I have four classes: ascii_t, utf8_t, utf16_t, and utf32_t.
>>> Assigning one type to another automatically converts it to the
>>> target type during the copy. (Converting to ascii_t will throw an
>>> exception if a resulting character won't fit into eight bits.)
>>>
>>
>> If so (and this is what I see in code) ASCII is misleading.
>> It should be called Latin1/ISO-8859-1 but not ASCII.
>
> Probably, but latin1_t isn't very obvious, and iso_8859_1_t is a little
> awkward to type. ;-) As I've said, this code was written solely for my
> company, I'd make a number of changes if I were going to submit it to
> Boost.

I'm a little concerned by this talk of ASCII and Latin1. When, say, utf8_t
is given a char* does it not treat is as OS-default encoded rather than
ASCII/Latin1? I've skimmed to code but havn't managed to work out how the
classes treat this case.

Alex

-- 
Easy SFTP for Windows Explorer (http://www.swish-sftp.org)

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk