Skip to main content


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 09:33 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
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 07:37 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
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 07:49 Go to previous message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
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: Fri Apr 26 04:38:33 GMT 2024

Powered by FUDForum. Page generated in 0.03141 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top