Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » handling both latin-1 and utf-8 files
handling both latin-1 and utf-8 files [message #898707] Fri, 27 July 2012 05:33 Go to next message
Vlad Dumitrescu is currently offline Vlad Dumitrescu
Messages: 318
Registered: July 2009
Location: Gothenburg
Senior Member
Hi!

My language files are encoded as Latin-1, but since the compiler's parser accepts anything inside comments and strings, many people in china and Russia and elsewhere use utf-8 in those places.

I did some quick tests and it looks like Xtext can handle those. Are there any hidden traps here?

best regards,
Vlad
Re: handling both latin-1 and utf-8 files [message #899013 is a reply to message #898707] Mon, 30 July 2012 03:37 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2809
Registered: July 2009
Senior Member
Hi Vlad,

Xtext can handle all encodings quite well (see IEncodingProvider). Of
course, you cannot mix encodings in the same file.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 27.07.12 11:33, schrieb Vlad Dumitrescu:
> Hi!
>
> My language files are encoded as Latin-1, but since the compiler's
> parser accepts anything inside comments and strings, many people in
> china and Russia and elsewhere use utf-8 in those places.
> I did some quick tests and it looks like Xtext can handle those. Are
> there any hidden traps here?
> best regards,
> Vlad
>
Re: handling both latin-1 and utf-8 files [message #899017 is a reply to message #899013] Mon, 30 July 2012 03:49 Go to previous message
Vlad Dumitrescu is currently offline Vlad Dumitrescu
Messages: 318
Registered: July 2009
Location: Gothenburg
Senior Member
Thank you, Sebastian.

What I meant was - with an infrastructure generated for a Latin-1 encoding, does it work to handle utf-8 files too, given the restriction that non-ascii characters are only found in comments and strings?

regards,
Vlad
Previous Topic:Updating Xtext 2.2.1 to 2.3.0
Next Topic:import an Xtext grammar
Goto Forum:
  


Current Time: Sat Jul 26 11:29:19 EDT 2014

Powered by FUDForum. Page generated in 0.05113 seconds