Suggest: Support for encodings

2 views
Skip to first unread message

icoz

unread,
Mar 13, 2008, 9:39:34 AM3/13/08
to HaiQ Development
I need to work with source-files with utf8-encoding.
HaiQ (rev340) shows garbage in russian comments and strings.
Who can add support for encodings? Or tell me, where can I fix it?
I found, if correct src/haiqcoreinterface/haiqcommon.cpp in function
read_text_file:
...
//QString ret=file.readAll();
QTextStream ts(&file);
ts.setCodec("UTF8");
QString ret=ts.readAll();
...

Then all is good, but only for utf8! If I load file in Windows-1251-
encoding, then I get garbage again. :(

I want:
1) menu with list of encodings
2) on menu click - change codec for active editor (or better for whole
project)
3) may be tool to recode files "on fly" (useful, when you add to your
project 3rd-party source) - some kind of import

What classes I should edit (or inherit)? What I should do?

jeremy....@gmail.com

unread,
Mar 14, 2008, 6:57:34 AM3/14/08
to ha...@googlegroups.com
Hi Icoz, let me think about this issue for a little while.
Regards,
Jeremy

icoz

unread,
Mar 14, 2008, 9:15:32 AM3/14/08
to HaiQ Development
I think it's better to do in this way:
1) In project options we have option "Project encoding". It describes
encoding for all *.cpp and *.h (may be *.pro)
2) If we import some source file, we must choose encoding of file.
HaiQ will automatically recode this file to project encoding.
So we have simple way to resolve problem of many encodings.
This is useful for projects with large amount of developers on
different systems. For example, on my work: we have a couple of
computers, there are redhat9 and ASPlinux 11. RedHat9 has KOI8-R as
default codepage, ASPLinux - Windows-1251. So we have troubles... :(

PS. You may look at small tool "recode". You have it in linux by
default, this is a win32-port http://unxutils.sourceforge.net/
Usage:
recode cp1251..utf8 SomeFile.TXT

icoz

unread,
Apr 3, 2008, 1:07:36 PM4/3/08
to HaiQ Development
Who can tell me, where I should seek place to do all this things? I
mean I need list of source files where i can add these features.
> default, this is a win32-porthttp://unxutils.sourceforge.net/
> Usage:
> recode cp1251..utf8 SomeFile.TXT

Jose Maria Garcia-Valdecasas

unread,
Apr 3, 2008, 4:25:31 PM4/3/08
to ha...@googlegroups.com
Hi icoz, most probably the best person to answer these questions is Jeremy, as he has coded the core of HaiQ. But... he will be a bit away the next days (he has been dad) :)

Cheers, Jose.

P.S: i will return coding HaiQ next week, so maybe i can help you with your stuff.


2008/4/3, icoz <vlad_...@rambler.ru>:

jeremy....@gmail.com

unread,
Apr 4, 2008, 7:34:19 AM4/4/08
to ha...@googlegroups.com
Yes, this is true (thanks Jose), I'm too busy right now taking care of my wife and new baby boy. I'll help you in a week or so when I have some spare minutes.
Regards, Jeremy

2008/4/3 Jose Maria Garcia-Valdecasas <jgvald...@gmail.com>:

SamT

unread,
Apr 4, 2008, 11:29:47 AM4/4/08
to HaiQ Development
Congratulation to Jeremy. :-)

Regards,
SamT

icoz

unread,
Apr 4, 2008, 5:51:45 PM4/4/08
to HaiQ Development
Congratulations! :) Did you choose a name for him?

On 4 апр, 15:34, jeremy.magl...@gmail.com wrote:
> Yes, this is true (thanks Jose), I'm too busy right now taking care of my
> wife and new baby boy. I'll help you in a week or so when I have some spare
> minutes.
> Regards, Jeremy
>
> 2008/4/3 Jose Maria Garcia-Valdecasas <jgvaldeca...@gmail.com>:
>
> > Hi icoz, most probably the best person to answer these questions is
> > Jeremy, as he has coded the core of HaiQ. But... he will be a bit away the
> > next days (he has been dad) :)
>
> > Cheers, Jose.
>
> > P.S: i will return coding HaiQ next week, so maybe i can help you with
> > your stuff.
>
> > 2008/4/3, icoz <vlad_ag...@rambler.ru>:

jeremy....@gmail.com

unread,
Apr 4, 2008, 7:24:19 PM4/4/08
to ha...@googlegroups.com
Thanks! The official announcement is here: http://www.hiqt.org/thomas/thomas-birth-announcement-96dpi.pdf
 
Jeremy
 
2008/4/4 icoz <vlad_...@rambler.ru>:
Reply all
Reply to author
Forward
0 new messages