View previous topic :: View next topic |
Author |
Message |
WeeGee
Joined: 03 Jan 2008 Posts: 6
|
Posted: Fri Jan 04, 2008 8:15 am Post subject: UTF8 |
|
|
Hello,
I just started trying Poseidon, and found it very useful. But there is one problem with UTF8: how can I configure that all sourcecode is UTF8 encoded? I've tried the menu Encoding, but it still doesn't read and save everything in UTF8, which kills all German Umlauts in my comments.
Thanks! |
|
Back to top |
|
|
WeeGee
Joined: 03 Jan 2008 Posts: 6
|
Posted: Fri Jan 04, 2008 8:16 am Post subject: |
|
|
BTW: This forum also has problems with Umlauts.. When I want to post a message with Umlauts, I get an debug error. |
|
Back to top |
|
|
Kuan Hsu
Joined: 15 Apr 2006 Posts: 143 Location: Taiwan
|
Posted: Tue Jan 08, 2008 11:44 am Post subject: Re: UTF8 |
|
|
WeeGee wrote: | Hello,
I just started trying Poseidon, and found it very useful. But there is one problem with UTF8: how can I configure that all sourcecode is UTF8 encoded? I've tried the menu Encoding, but it still doesn't read and save everything in UTF8, which kills all German Umlauts in my comments.
Thanks! |
I assume that the problem is poseidon couldn't load your existed files correctly. While loading non-UTF files, poseidon will get current system code page, then translate the files to UTF8. In my windows system, the ANSI code page is 950( BIG5 ), I can't show German Umlauts correctly.
So, maybe your existed files encode aren't match your system code page.
In my testing, I use mozilla Char Detector library to get code page of source file and use this code page to translate to UTF8, it seems works, but I need more test and need an extra dll, hmm.....I don't like.....
Could you try please what your files encode are and they are match your system code page or not?
ps:
I use madedit to change the encode of file then try in poseidon, it also used mozilla Char Detector library. |
|
Back to top |
|
|
WeeGee
Joined: 03 Jan 2008 Posts: 6
|
Posted: Wed Jan 09, 2008 1:25 am Post subject: |
|
|
The files are shared between linux (which writes them as UTF- and windoze (which uses a different "standard windows" encoding), so I need a switch in Poseidon to read and write all files in my project as UTF-8, no matter what windoze says. |
|
Back to top |
|
|
Kuan Hsu
Joined: 15 Apr 2006 Posts: 143 Location: Taiwan
|
Posted: Thu Jan 10, 2008 9:31 pm Post subject: |
|
|
WeeGee wrote: | The files are shared between linux (which writes them as UTF- and windoze (which uses a different "standard windows" encoding), so I need a switch in Poseidon to read and write all files in my project as UTF-8, no matter what windoze says. |
So the existed files original encode are UTF-8......
Please tell me When openning your file in poseidon, the status bar is shown "MBCS" or "UTF-8"? and may I ask you e-mail one your file to me for testing please? |
|
Back to top |
|
|
WeeGee
Joined: 03 Jan 2008 Posts: 6
|
Posted: Sat Jan 12, 2008 6:05 am Post subject: |
|
|
It says MBCS, until I change it for that file in the menu. But when I change it, nothing happens with the text, it still looks like this:
Code: |
import rtai.lxrt; //für rt_get_time_ns
import de.tionex.constants; //für BIT_TEST
|
You've got eMail. |
|
Back to top |
|
|
Kuan Hsu
Joined: 15 Apr 2006 Posts: 143 Location: Taiwan
|
Posted: Sat Jan 12, 2008 11:02 am Post subject: |
|
|
I've gotten your file, thanks!
I've opened the file in poseidon, poseidon said it is UTF-8, I've checked the hex, the first three bytes are EF BB BF, it should be BOM-UTF8 with UNIX end of line.
I've tried the file in poseidon, madedit, notepad++, crimson editor, windows notepad, all have UTF-8 support and identify the file is UTF-8 but show the texts incorrectly.
Quote: | It says MBCS, until...... |
Poseidon will show MBCS when the file isn't encode unicode / or without BOM, Maybe you e-mail wrong file? |
|
Back to top |
|
|
WeeGee
Joined: 03 Jan 2008 Posts: 6
|
Posted: Sun Jan 13, 2008 12:53 pm Post subject: |
|
|
OK, now I know what's going wrong.. the file I sent you was made with Poseidon, so it got the correct header bytes.
My original files don't have a header, they start with the text right away. So Poseidon (and other tools) don't know that they are UTF-8. Only Eclipse and some other IDEs where you can select to handle all files as UTF-8 show the correct Umlauts.
I can't save the files as correct UTF-8 with header, because I'm not the only one working with these files..they are not "mine".
So the question is: can you make a global switch like in Eclipse? Otherwise I can't use Poseidon. |
|
Back to top |
|
|
Kuan Hsu
Joined: 15 Apr 2006 Posts: 143 Location: Taiwan
|
Posted: Sun Jan 13, 2008 8:34 pm Post subject: |
|
|
WeeGee wrote: | My original files don't have a header, they start with the text right away. So Poseidon (and other tools) don't know that they are UTF-8. Only Eclipse and some other IDEs where you can select to handle all files as UTF-8 show the correct Umlauts. |
OK, so poseidon need understand the what original file encode( code page) is, I will compile poseidon with mozilla Char Detector library then commit it( rev. 212 ), please wait until I come home......
Please e-mail me the original file for testing, thanks!
I've gotten the file, It's UTF8 without BOM.
So maybe I will write some codes to determine if it's UTF8 or not while reading no UTF BOM file instead of link with Char Detector library, it should works......
Still until I come home.....
I've commit rev.212, I wish that it can solve the problem. |
|
Back to top |
|
|
WeeGee
Joined: 03 Jan 2008 Posts: 6
|
Posted: Fri Jan 18, 2008 9:53 am Post subject: |
|
|
well it works!
thanks!
I get a "Parser Error Failure" when I open some files. One reason could be mixin or version(), but I also have some files which gave me that error without mixins or version() statements. |
|
Back to top |
|
|
Kuan Hsu
Joined: 15 Apr 2006 Posts: 143 Location: Taiwan
|
Posted: Sun Jan 20, 2008 9:32 pm Post subject: |
|
|
WeeGee wrote: | well it works!
thanks!
I get a "Parser Error Failure" when I open some files. One reason could be mixin or version(), but I also have some files which gave me that error without mixins or version() statements. |
Maybe mixin......
DMD has more new syntax that parser need be updated, although I don't understand hasan's wonderful code( Code Analyzer ) completely, I'll try to modify it then test on DWT, Poseidon, DFL and Tango.
Please Wait...... |
|
Back to top |
|
|
|