[cfe-dev] Wide strings and clang::StringLiteral.

Jean-Daniel Dupas devlists at shadowlab.org
Fri Dec 5 01:15:13 PST 2008


Le 5 déc. 08 à 05:48, Eli Friedman a écrit :

> On Thu, Dec 4, 2008 at 8:02 PM, Chris Lattner <clattner at apple.com>  
> wrote:
>>>> 2) Add -finput-charset to clang.  Is iconv generally available  
>>>> (e.g.
>>>> on windows?) if not, we'll need some configury magic to detect it.
>>>
>>> It's not particularly difficult to get, but Windows users are  
>>> unlikely
>>> to have it installed.
>>
>> Ok, it would be nice to not add a dependency so people can get  
>> started
>> quickly.  Are there any license issues?
>
> libiconv is LGPL; whether this is an "issue" license probably depends
> on the company.  There's also apparently a lightweight alternative
> called win_iconv which I stumbled upon while I was looking around, but
> I don't know much about it.


You may also considere ICU that is distributed with a nonrestrictive  
license:

	http://source.icu-project.org/repos/icu/icu/trunk/license.html

It compile fine on Windows (that's what the WebKit and Safari use for  
unicode handling), and is bundle with most modern OS (Linux, OS X)

> 1) Document StringLiteral as being canonicalized to UTF8.  We'll
> require sema to translate the input string to utf8, and codegen and
> other clients to convert it to the character set they want.
> 2) Add -finput-charset to clang.  Is iconv generally available (e.g.
> on windows?) if not, we'll need some configury magic to detect it.
> 3) Teach sema about UTF8 input and iconv.  Sema should handle the
> default cases (e.g. UTF8 and character sets where no "bad" things
> occur) as quickly as possible, while falling back to iconv for hard
> cases (or emitting an error if iconv isn't available).
> 4) Enhance the lexer, if required, to handle lexing strings properly.
> 5) Enhance codegen to translate into the execution char set.
> 6) Start working on character constants.


And do not forget: Enhance rewriter to preserve input encoding.



More information about the cfe-dev mailing list