FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

UTF8

 
Post new topic   Reply to topic     Forum Index -> Poseidon
View previous topic :: View next topic  
Author Message
WeeGee



Joined: 03 Jan 2008
Posts: 6

PostPosted: Fri Jan 04, 2008 8:15 am    Post subject: UTF8 Reply with quote

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
View user's profile Send private message
WeeGee



Joined: 03 Jan 2008
Posts: 6

PostPosted: Fri Jan 04, 2008 8:16 am    Post subject: Reply with quote

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
View user's profile Send private message
Kuan Hsu



Joined: 15 Apr 2006
Posts: 143
Location: Taiwan

PostPosted: Tue Jan 08, 2008 11:44 am    Post subject: Re: UTF8 Reply with quote

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..... Very Happy

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
View user's profile Send private message Send e-mail
WeeGee



Joined: 03 Jan 2008
Posts: 6

PostPosted: Wed Jan 09, 2008 1:25 am    Post subject: Reply with quote

The files are shared between linux (which writes them as UTF-Cool 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
View user's profile Send private message
Kuan Hsu



Joined: 15 Apr 2006
Posts: 143
Location: Taiwan

PostPosted: Thu Jan 10, 2008 9:31 pm    Post subject: Reply with quote

WeeGee wrote:
The files are shared between linux (which writes them as UTF-Cool 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...... Shocked

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
View user's profile Send private message Send e-mail
WeeGee



Joined: 03 Jan 2008
Posts: 6

PostPosted: Sat Jan 12, 2008 6:05 am    Post subject: Reply with quote

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
View user's profile Send private message
Kuan Hsu



Joined: 15 Apr 2006
Posts: 143
Location: Taiwan

PostPosted: Sat Jan 12, 2008 11:02 am    Post subject: Reply with quote

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? Rolling Eyes
Back to top
View user's profile Send private message Send e-mail
WeeGee



Joined: 03 Jan 2008
Posts: 6

PostPosted: Sun Jan 13, 2008 12:53 pm    Post subject: Reply with quote

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. Rolling Eyes
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. Sad
Back to top
View user's profile Send private message
Kuan Hsu



Joined: 15 Apr 2006
Posts: 143
Location: Taiwan

PostPosted: Sun Jan 13, 2008 8:34 pm    Post subject: Reply with quote

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. Rolling Eyes


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...... Very Happy

Please e-mail me the original file for testing, thanks! Very Happy



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
View user's profile Send private message Send e-mail
WeeGee



Joined: 03 Jan 2008
Posts: 6

PostPosted: Fri Jan 18, 2008 9:53 am    Post subject: Reply with quote

well it works! Cool
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
View user's profile Send private message
Kuan Hsu



Joined: 15 Apr 2006
Posts: 143
Location: Taiwan

PostPosted: Sun Jan 20, 2008 9:32 pm    Post subject: Reply with quote

WeeGee wrote:
well it works! Cool
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...... Rolling Eyes
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Poseidon All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group