Community
Participate
Working Groups
I'm using Texo 0.1.0.v201112171308. Some german umlauts in my model are not correctly encoded in the generated code. For example the character "ü" in the model is represented by "√º" in the generated code (my project uses UTF-8 encoding). I think it worked correctly not long ago (say 2 months or so) but I'm not sure.
Hi Peter, Where is this text generated? This is an old issue which should be solved. I have a testcase which generates a russian text in a comment and that works fine. Do you have an example ecore I can use? gr. Martin
Hi Martin, I have seen now that it only happens after the initial generation: 1. ecore with comment "äöü" 2. Texo generates <!-- begin-model-doc -->äöü 3. The next generation produces garbage from the umlauts Every new generation will add garbage to the umlauts Starting with "ü" it goes like this: 1st generation: "ü", 2nd generation "√º", 3rd generation "‚àö¬∫", 4th generation "‚Äö√†√∂¬¨‚à´" and so on... So, I assume it is not a texo problem at all but a general emf generator problem.
Created attachment 210255 [details] example model
Hi Peter, I could not reproduce it using texo model generation. See the attached model. I regenerated the model several times but the umlauts are still there, correctly placed in the source code. gr. Martin
Created attachment 210256 [details] java file with umlauts
Could it be the file encoding specified for your workspace? See the workspace preferences, mine are set at UTF-8. Texo will generate utf-8 encoding.
My Workspace encoding is set to MacRoman (default), but the project encoding is set to UTF-8. I have tried setting the workspace encoding to UTF-8 but it didn't help. I'm going to try out your example in my workspace.
Your example behaves the same way as my ecore in my workspace: The first generation was ok and the second generation produced this: /** * A representation of the model object '<em><b>Test</b></em>'. <!-- * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> äöü * äöü äöü äöü <!-- end-model-doc --> * * @generated */
I have really no idea why this fails :-( For the regeneration, normally the file should not be touched again, as nothing changed. But again I have really no idea why this fails with you and works with me. Can you somehow check the encoding of the file itself (it is utf-8)? Through another editor maybe.. gr. Martin
I checked the file. It really is UTF-8 encoded. I did another test with your ecore: In a new workspace, I set the workspace encoding to UTF-8, created a new empty emf project, copied your ecore file to the model folder and generated the model code with the texo menu. The generated Test.java had the umlauts. Another generation destroyed the umlauts again. I then created a genmodel for the ecore, generated the classical emf java sources and regenerated them. Here the umlauts are preserved. I think the merging generator needs to read the file and decide what to write. Perhaps in the reading step the encoding is not respected?
Indeed the merger read the original file without encoding. I changed this and published a new build. Can you retry with this latest build? gr. Martin
Thanks a lot. It's working perfectly now. Best regards, Peter