|
From: Alain A. <ala...@wa...> - 2014-01-29 08:25:59
|
<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font size="-1">Hi,<br>
<br>
I have created a dbf with data which where in an utf-8 file.<br>
To make it in a dbf file, I transform datas with hb_utf8tostr()<br>
It works, and looking for the dbf datas with hbdbu (from Pritpal),
accentued datas are correctly displayed.<br>
Looking with dbview, such datas aren't displayed, and there are
errors in the console, opening this dbf:<br>
<br>
<i>alain@Gramps-JujuLand:/opt/TuxPrograms/trunks/harbour/addons/hwgui-src/hwgui/samples/gtk_samples$
./dbview</i><i><br>
</i><i>(dbview:5551): Pango-CRITICAL **: pango_layout_set_text:
assertion `length == 0 || text != NULL' failed</i><i><br>
</i><i>(dbview:5551): Pango-CRITICAL **: pango_layout_set_text:
assertion `length == 0 || text != NULL' failed</i><i><br>
</i><i>(dbview:5551): Pango-CRITICAL **: pango_layout_set_text:
assertion `length == 0 || text != NULL' failed</i><i><br>
</i><br>
Changing codepage for datas to FR850 doesn't avoid this bug.<br>
And in dbview, it reports the failing field with the datas of the
previous field in the record.<br>
</font><br>
<font size="-1"><a class="moz-txt-link-freetext" href="https://www.dropbox.com/s/trx5qak85535svp/dbview1.png">https://www.dropbox.com/s/trx5qak85535svp/dbview1.png</a><br>
<br>
Clicking on one of this field, a value of another field appears.<br>
</font><br>
<font size="-1"><a class="moz-txt-link-freetext" href="https://www.dropbox.com/s/vb339yslah9nw98/dbview2.png">https://www.dropbox.com/s/vb339yslah9nw98/dbview2.png</a><br>
<br>
Thank to help me.<br>
A+<br>
</font>
<div class="moz-signature">-- <br>
<hr> Alain Aupeix<br>
<a class="moz-txt-link-freetext"
href="http://jujuland.pagesperso-orange.fr/">http://jujuland.pagesperso-orange.fr/</a><br>
<a class="moz-txt-link-freetext"
href="http://pissobi-lacassagne.pagesperso-orange.fr/">http://pissobi-lacassagne.pagesperso-orange.fr/</a><br>
<hr> <small>U.buntu 12.04 | G.ramps 3.4.6-1 | H.arbour 3.2.0dev
(2014-01-14 22:36) | HbIDE (Rev.279) | Five.Linux (r138) |
Hw.Gui (2216)</small>
<hr></div>
</body>
</html>
|
|
From: Alexander S.K. <al...@be...> - 2014-01-29 10:53:00
|
Hmm... strange, it worked before. I'll check it. Regards, Alexander. |
|
From: Alexander S.K. <al...@be...> - 2014-01-29 12:11:25
|
There is a commented line in dbview.prg:
hwg_SetAppLocale( "KOI8-R" )
It must present, if the data isn't in utf-8 or EN codepage.
You need to call this function with a name of your codepage - I
think, it is the "ISO-8859-1":
hwg_SetAppLocale( "ISO-8859-1" )
Regards, Alexander.
P.S. This is for GTK version only.
|
|
From: Alain A. <ala...@wa...> - 2014-01-29 17:25:21
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 29/01/2014 13:11, Alexander S.Kresin
a écrit :<br>
</div>
<blockquote cite="mid:52E...@be..." type="cite">
<pre wrap=""> There is a commented line in dbview.prg:
hwg_SetAppLocale( "KOI8-R" )
It must present, if the data isn't in utf-8 or EN codepage.
You need to call this function with a name of your codepage - I
think, it is the "ISO-8859-1":
hwg_SetAppLocale( "ISO-8859-1" )</pre>
</blockquote>
Thanks for the answer, I have no more error message in the console,
but I have already an encoding problem.<br>
Have a look to the hard-copy ...<br>
<br>
<a class="moz-txt-link-freetext" href="https://www.dropbox.com/s/trx5qak85535svp/dbview1.png">https://www.dropbox.com/s/trx5qak85535svp/dbview1.png</a><br>
<br>
Another question about hw-gui : <br>
<br>
Is there a recent documentation of hw-gui ?<br>
The one found on the web is very old.<br>
Where or how can I found the list of hw-gui functions list ?<br>
<br>
A+<br>
<div class="moz-signature">-- <br>
<hr>
Alain Aupeix<br>
<a class="moz-txt-link-freetext" href="http://jujuland.pagesperso-orange.fr/">http://jujuland.pagesperso-orange.fr/</a><br>
<a class="moz-txt-link-freetext" href="http://pissobi-lacassagne.pagesperso-orange.fr/">http://pissobi-lacassagne.pagesperso-orange.fr/</a><br>
<hr>
<small>U.buntu 12.04 | G.ramps 3.4.6-1 | H.arbour 3.2.0dev
(2014-01-27 14:04) | HbIDE (Rev.279) | Five.Linux (r138) |
Hw.Gui (2217)</small>
<hr></div>
</body>
</html>
|
|
From: Alexander S.K. <al...@be...> - 2014-01-30 07:47:13
|
Alain Aupeix writes:
> Thanks for the answer, I have no more error message in the console, but
> I have already an encoding problem.
> Have a look to the hard-copy ...
>
Then try to use hwg_SetAppLocale( "CP850" ) instead of "ISO-8859-1".
>
> Another question about hw-gui :
>
> Is there a recent documentation of hw-gui ?
> The one found on the web is very old.
It's a really sore point. I hope that I will have a time and an
energy to update it.
> Where or how can I found the list of hw-gui functions list ?
>
For now - only from sources and samples.
Regards, Alexander.
|
|
From: Alain A. <ala...@wa...> - 2014-01-30 12:47:21
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 30/01/2014 08:47, Alexander S.Kresin
a écrit :<br>
</div>
<blockquote cite="mid:52E...@be..." type="cite">
<pre wrap="">Alain Aupeix writes:
</pre>
<blockquote type="cite">
<pre wrap="">Thanks for the answer, I have no more error message in the console, but
I have already an encoding problem.
Have a look to the hard-copy ...
</pre>
</blockquote>
<pre wrap="">
Then try to use hwg_SetAppLocale( "CP850" ) instead of "ISO-8859-1".</pre>
</blockquote>
Thanks, it done the trick.<br>
But I don't understand the purpose of hb_CdpSelect() and SetDataCP()<br>
<br>
It works without using it.<br>
<br>
Just a little problem easily solved. All the accentued strings must
now be translated using hb_utf8tostr() to display correctly accents.
It's not a real problem, I already do it in all my progs (probably
due to the fact that under Linux, editors use utf-8).<br>
<br>
But, there is also another similar problem in gets. I suppose I will
have to modify some prg in hw-gui libs (hb_cdpselect() and SetdataCP
don't solve the problem.<br>
<br>
Example: prÛnom instead of prénom<br>
<br>
A+<br>
<div class="moz-signature">-- <br>
<hr>
Alain Aupeix<br>
<a class="moz-txt-link-freetext" href="http://jujuland.pagesperso-orange.fr/">http://jujuland.pagesperso-orange.fr/</a><br>
<a class="moz-txt-link-freetext" href="http://pissobi-lacassagne.pagesperso-orange.fr/">http://pissobi-lacassagne.pagesperso-orange.fr/</a><br>
<hr>
<small>U.buntu 12.04 | G.ramps 3.4.6-1 | H.arbour 3.2.0dev
(2014-01-27 14:04) | HbIDE (Rev.279) | Five.Linux (r138) |
Hw.Gui (2217)</small>
<hr></div>
</body>
</html>
|
|
From: Alexander S.K. <al...@be...> - 2014-01-31 07:48:12
|
Alain Aupeix writes: > But I don't understand the purpose of hb_CdpSelect() and SetDataCP() > > It works without using it. SetDataCP() isn't a HwGUI function ( all HwGUI functions are prefixed with hwg_ ), it is determined in dbview.prg, and the only thing it does is setting a Public variable DataCP - if is is set, dbf files are opened with DataCP as a codepage. Using of hb_CdpSelect() and SetDataCP() is needed, if they set different codepages - in this case all data from the dbf is automatically converted from its codepage to that one, which is set by hb_CdpSelect(). > But, there is also another similar problem in gets. I suppose I will > have to modify some prg in hw-gui libs (hb_cdpselect() and SetdataCP > don't solve the problem. > > Example: prÛnom instead of prénom > Sorry, I didn't understand, what the problem is. Regards, Alexander. |
|
From: Alain A. <ala...@wa...> - 2014-01-31 07:57:49
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 31/01/2014 08:48, Alexander S.Kresin
a écrit :<br>
</div>
<blockquote cite="mid:52E...@be..." type="cite">
<pre wrap="">Alain Aupeix writes:
</pre>
<blockquote type="cite">
<pre wrap="">But I don't understand the purpose of hb_CdpSelect() and SetDataCP()
It works without using it.
</pre>
</blockquote>
<pre wrap="">
SetDataCP() isn't a HwGUI function ( all HwGUI functions are prefixed
with hwg_ ), it is determined in dbview.prg, and the only thing it does
is setting a Public variable DataCP - if is is set, dbf files are opened
with DataCP as a codepage. Using of hb_CdpSelect() and SetDataCP() is
needed, if they set different codepages - in this case all data from the
dbf is automatically converted from its codepage to that one, which is
set by hb_CdpSelect().</pre>
</blockquote>
ok, I imagine what is the purpose, but it seem not necessary in
dbview.
<blockquote cite="mid:52E...@be..." type="cite">
<blockquote type="cite">
<pre wrap="">Example: prÛnom instead of prénom
</pre>
</blockquote>
<pre wrap=""> Sorry, I didn't understand, what the problem is.</pre>
</blockquote>
With this hardcopy, you will easily understand<br>
<br>
<a class="moz-txt-link-freetext" href="https://www.dropbox.com/s/0ursjeenjev616h/New_sort.png">https://www.dropbox.com/s/0ursjeenjev616h/New_sort.png</a><br>
<br>
Thanks<br>
A+<br>
<div class="moz-signature">-- <br>
<hr>
Alain Aupeix<br>
<a class="moz-txt-link-freetext" href="http://jujuland.pagesperso-orange.fr/">http://jujuland.pagesperso-orange.fr/</a><br>
<a class="moz-txt-link-freetext" href="http://pissobi-lacassagne.pagesperso-orange.fr/">http://pissobi-lacassagne.pagesperso-orange.fr/</a><br>
<hr>
<small>U.buntu 12.04 | G.ramps 3.4.6-1 | H.arbour 3.2.0dev
(2014-01-27 14:04) | HbIDE (Rev.279) | Five.Linux (r138) |
Hw.Gui (2217)</small>
<hr></div>
</body>
</html>
|
|
From: Alexander S.K. <al...@be...> - 2014-01-31 08:44:48
|
>> Sorry, I didn't understand, what the problem is. > With this hardcopy, you will easily understand > > https://www.dropbox.com/s/0ursjeenjev616h/New_sort.png > So, you tell, that you input prénom in the get control, but prÛnom is displayed ? |
|
From: Alain A. <ala...@wa...> - 2014-01-31 08:57:29
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 31/01/2014 09:44, Alexander S.Kresin
a écrit :<br>
</div>
<blockquote cite="mid:52E...@be..." type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap=""> Sorry, I didn't understand, what the problem is.
</pre>
</blockquote>
<pre wrap="">With this hardcopy, you will easily understand
<a class="moz-txt-link-freetext" href="https://www.dropbox.com/s/0ursjeenjev616h/New_sort.png">https://www.dropbox.com/s/0ursjeenjev616h/New_sort.png</a>
</pre>
</blockquote>
<pre wrap="">
So, you tell, that you input prénom in the get control, but prÛnom is
displayed ?
</pre>
</blockquote>
Yes, that's it.<br>
<br>
I have already saw this type of problem, it was due to a codepage
problem, but I'm not able to retrieve which were the codepages.<br>
<br>
A+<br>
<div class="moz-signature">-- <br>
<hr>
Alain Aupeix<br>
<a class="moz-txt-link-freetext" href="http://jujuland.pagesperso-orange.fr/">http://jujuland.pagesperso-orange.fr/</a><br>
<a class="moz-txt-link-freetext" href="http://pissobi-lacassagne.pagesperso-orange.fr/">http://pissobi-lacassagne.pagesperso-orange.fr/</a><br>
<hr>
<small>U.buntu 12.04 | G.ramps 3.4.6-1 | H.arbour 3.2.0dev
(2014-01-27 14:04) | HbIDE (Rev.279) | Five.Linux (r138) |
Hw.Gui (2217)</small>
<hr></div>
</body>
</html>
|
|
From: Alain A. <ala...@wa...> - 2014-01-31 09:34:26
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 31/01/2014 09:57, Alain Aupeix a
écrit :<br>
</div>
<blockquote cite="mid:52E...@wa..." type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">Le 31/01/2014 09:44, Alexander
S.Kresin a écrit :<br>
</div>
<blockquote cite="mid:52E...@be..." type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap=""> Sorry, I didn't understand, what the problem is.
</pre>
</blockquote>
<pre wrap="">With this hardcopy, you will easily understand
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://www.dropbox.com/s/0ursjeenjev616h/New_sort.png">https://www.dropbox.com/s/0ursjeenjev616h/New_sort.png</a>
</pre>
</blockquote>
<pre wrap=""> So, you tell, that you input prénom in the get control, but prÚnom is
displayed ?
</pre>
</blockquote>
Yes, that's it.<br>
<br>
I have already saw this type of problem, it was due to a codepage
problem, but I'm not able to retrieve which were the codepages.<br>
</blockquote>
I have been able to find the problem:<br>
<br>
I have a file I saved using ANSI codepage<br>
<br>
3 TIME 11:16:11<br>
0 @I0270@ INDI<br>
1 NAME Véronique /Authier/<br>
2 GIVN Véronique<br>
2 SURN Authier<br>
<br>
<br>
I open it using OEM codepage with PSPad (and wine)<br>
<br>
3 TIME 11:16:11<br>
0 @I0270@ INDI<br>
1 NAME VÚronique /Authier/<br>
2 GIVN VÚronique<br>
2 SURN Authier<br>
<br>
It seems that hwg_SetAppLocale( "CP850" ) is equivalent to ANSI, and
that the get system waits for OEM (or STR ??)<br>
Am-I wrong ?<br>
<br>
A+<br>
<div class="moz-signature">-- <br>
<hr>
Alain Aupeix<br>
<a class="moz-txt-link-freetext" href="http://jujuland.pagesperso-orange.fr/">http://jujuland.pagesperso-orange.fr/</a><br>
<a class="moz-txt-link-freetext" href="http://pissobi-lacassagne.pagesperso-orange.fr/">http://pissobi-lacassagne.pagesperso-orange.fr/</a><br>
<hr>
<small>U.buntu 12.04 | G.ramps 3.4.6-1 | H.arbour 3.2.0dev
(2014-01-27 14:04) | HbIDE (Rev.279) | Five.Linux (r138) |
Hw.Gui (2217)</small>
<hr></div>
</body>
</html>
|
|
From: Alexander S.K. <al...@be...> - 2014-01-31 09:46:51
|
> I have been able to find the problem:
>
> I have a file I saved using ANSI codepage
>
> 3 TIME 11:16:11
> 0 @I0270@ INDI
> 1 NAME Véronique /Authier/
> 2 GIVN Véronique
> 2 SURN Authier
>
>
> I open it using OEM codepage with PSPad (and wine)
>
> 3 TIME 11:16:11
> 0 @I0270@ INDI
> 1 NAME VÚronique /Authier/
> 2 GIVN VÚronique
> 2 SURN Authier
>
> It seems that hwg_SetAppLocale( "CP850" ) is equivalent to ANSI, and
> that the get system waits for OEM (or STR ??)
> Am-I wrong ?
>
I think, you're right.
We have set the "CP850" - so, all strings are converted from "CP850"
to utf8 before be displayed, but the characters, which are input from
the keyboard, are, probably, in other codepage, so we need to know how
this codepage is called. In this case you need to set hwg_setAppLocale()
to this codepage, and hb_cdpSelect() to appropiate, but SetDataCP()
should be set to "FR850".
|
|
From: Alain A. <ala...@wa...> - 2014-01-31 10:17:39
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 31/01/2014 10:46, Alexander S.Kresin
a écrit :<br>
</div>
<blockquote cite="mid:52E...@be..." type="cite">
<blockquote type="cite">
<pre wrap="">It seems that hwg_SetAppLocale( "CP850" ) is equivalent to ANSI, and
that the get system waits for OEM (or STR ??)
Am-I wrong ?
</pre>
</blockquote>
<pre wrap=""> I think, you're right.
We have set the "CP850" - so, all strings are converted from "CP850"
to utf8 before be displayed, but the characters, which are input from
the keyboard, are, probably, in other codepage, so we need to know how
this codepage is called. In this case you need to set hwg_setAppLocale()
to this codepage, and hb_cdpSelect() to appropiate, but SetDataCP()
should be set to "FR850".</pre>
</blockquote>
I have made some test, but none are ok<br>
<br>
if I set cdpselect to CP850 and datacp to FR850, and comment
setapplocal, dbf data display is wrong and I have an error with
PANGO (as at the beginning)<br>
<br>
If I uncomment setapplocal and set it to UTF8, and also set
cdpselect to UTF8, dbf datas and menus are correctly displayed, but
I have PANGO error in gets<br>
<br>
I really don't know which codepage to use.<br>
<br>
A+<br>
-- <br>
<div class="moz-signature">
<hr>
Alain Aupeix<br>
<a class="moz-txt-link-freetext" href="http://jujuland.pagesperso-orange.fr/">http://jujuland.pagesperso-orange.fr/</a><br>
<a class="moz-txt-link-freetext" href="http://pissobi-lacassagne.pagesperso-orange.fr/">http://pissobi-lacassagne.pagesperso-orange.fr/</a><br>
<hr>
<small>U.buntu 12.04 | G.ramps 3.4.6-1 | H.arbour 3.2.0dev
(2014-01-27 14:04) | HbIDE (Rev.279) | Five.Linux (r138) |
Hw.Gui (2217)</small>
<hr></div>
</body>
</html>
|
|
From: Alexander S.K. <al...@be...> - 2014-01-31 10:30:34
|
> I have made some test, but none are ok
>
What about:
hwg_SetAppLocale( "CP1251" )
hb_cdpSelect( "FRWIN" )
SetDataCP( "FR850")
|
|
From: Alexander S.K. <al...@be...> - 2014-02-03 10:06:45
|
> I suppose that conversion are made from and to UTF8, as GTK or must > probably use UTF8 only > > I suppose that all the hwg functions use these two function only > Wouldn't it be suitable in a few case to have these functions able to > convert from and to other than UTF8 ? > Could it be a solution to that problem ? > I must say that this problem is too hard for me, and the questions I > said are perhaps stupide ... > Yes, GTK uses utf8, all strings must be in utf8 before displaying on the screen. If strings in our application are in utf8 already, we don't use hwg_setAppLocale(). If not, we set our codepage with hwg_setAppLocale() - so all strings are converted to utf8 before using in GTK functions. If strings in dbf files uses other codepage, we need to convert them to the codepage, which we use in the application. For doing this automatically, we set separately application codepage with hb_cdpSelect() and database codepage - using the CODEPAGE clause of USE command ( in dbview.prg it is done, using the setDataCP() ). Have in mind that the name of a codepage in hwg_setAppLocale() is a name, defined in GTK or somewhere else and it is deffir from the Harbour's codepage name, which is used in hb_cdpSelect() or in USE ... CODEPAGE ... command. Regards, Alexander. |
|
From: Alain A. <ala...@wa...> - 2014-02-03 10:18:36
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 03/02/2014 11:06, Alexander S.Kresin
a écrit :<br>
</div>
<blockquote cite="mid:52E...@be..." type="cite">
<pre wrap=""> Yes, GTK uses utf8, all strings must be in utf8 before displaying on
the screen.
If strings in our application are in utf8 already, we don't use
hwg_setAppLocale().
If not, we set our codepage with hwg_setAppLocale() - so all strings are
converted to utf8 before using in GTK functions. If strings in dbf files
uses other codepage, we need to convert them to the codepage, which we
use in the application. For doing this automatically, we set separately
application codepage with hb_cdpSelect() and database codepage - using
the CODEPAGE clause of USE command ( in dbview.prg it is done, using the
setDataCP() ).
Have in mind that the name of a codepage in hwg_setAppLocale() is a
name, defined in GTK or somewhere else and it is deffir from the
Harbour's codepage name, which is used in hb_cdpSelect() or in USE ...
CODEPAGE ... command.</pre>
</blockquote>
Thanks for the explanations.<br>
<br>
To make it work correctly in menus, datas, and gets, i use this:<br>
<br>
<small><i>REQUEST HB_CODEPAGE_FR850</i><i><br>
</i><i>REQUEST HB_CODEPAGE_FRISO</i><i><br>
</i><i>....</i><i><br>
</i><i>hwg_SetAppLocale( "ISO8859-1" )</i><i><br>
</i><i>hb_CdpSelect( "FRISO" )</i><i><br>
</i><i>SetDataCP( "CP850" ) </i><i><br>
</i></small><br>
What I didn't know is use ... CODEPAGE<br>
If I understand well, I can fill a dbf with utf-8 datas ?<br>
It will simplify my tools which generates an utf-8 txt file from
utf-8 source, but using an str dbf format.<br>
<br>
I had a crash trying to modify a dbf structure which was created
with dbu (the 5.3 version adapted to harbour) and which also corrupt
the dbf.<br>
I'll send a report soon, if I confirm it<br>
<br>
Thanks<br>
A+<br>
<div class="moz-signature">-- <br>
<hr>
Alain Aupeix<br>
<a class="moz-txt-link-freetext" href="http://jujuland.pagesperso-orange.fr/">http://jujuland.pagesperso-orange.fr/</a><br>
<a class="moz-txt-link-freetext" href="http://pissobi-lacassagne.pagesperso-orange.fr/">http://pissobi-lacassagne.pagesperso-orange.fr/</a><br>
<hr>
<small>U.buntu 12.04 | G.ramps 3.4.6-1 | H.arbour 3.2.0dev
(2014-01-27 14:04) | HbIDE (Rev.279) | Five.Linux (r138) |
Hw.Gui (2217)</small>
<hr></div>
</body>
</html>
|
|
From: Alexander S.K. <al...@be...> - 2014-02-03 11:30:28
|
> > To make it work correctly in menus, datas, and gets, i use this: > > /REQUEST HB_CODEPAGE_FR850// > //REQUEST HB_CODEPAGE_FRISO// > //....// > //hwg_SetAppLocale( "ISO8859-1" )// > //hb_CdpSelect( "FRISO" )// > //SetDataCP( "CP850" ) // SetDataCP( "FR850" ) "CP850" isn't a Harbour's name for a codepage. > / > What I didn't know is use ... CODEPAGE In dbview.prg databases are opened with a codepage, defined with SetDataCP() > If I understand well, I can fill a dbf with utf-8 datas ? Yes, why not ? I'm not sure only about a possibility to use fields with utf-8 strings in indexes. There was a thread "Unicode in DBF" in november in the Harbour developers mail list. Regards, Alexander. |
|
From: Alain A. <ala...@wa...> - 2014-01-31 13:58:29
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 31/01/2014 13:39, Alain Aupeix a
écrit :<br>
</div>
<blockquote cite="mid:52E...@wa..." type="cite">It
seems that SetAppLocale is the master, and all the values we can
set for cdp or datacp are not executed.<br>
</blockquote>
I had a look to what was doing SetAppLocal() and I saw that in
window.c, there where only 3 functions concerning the value of
SetAppLocale :<br>
<br>
<small><i>HB_FUNC( HWG_SETAPPLOCALE )</i> </small>which set
sZAppLocale<br>
<br>
<small><i>gchar * hwg_convert_to_utf8( const char * szText )</i><i>
</i></small>which converts strings to UTF8<br>
<br>
<small><i>gchar * hwg_convert_from_utf8( const char * szText ) </i></small>which
converts strings from UTF8 <br>
<br>
I suppose that conversion are made from and to UTF8, as GTK or must
probably use UTF8 only<br>
<br>
I suppose that all the hwg functions use these two function only<br>
Wouldn't it be suitable in a few case to have these functions able
to convert from and to other than UTF8 ?<br>
Could it be a solution to that problem ?<br>
I must say that this problem is too hard for me, and the questions I
said are perhaps stupide ...<br>
<br>
A+<br>
<div class="moz-signature">-- <br>
<hr>
Alain Aupeix<br>
<a class="moz-txt-link-freetext" href="http://jujuland.pagesperso-orange.fr/">http://jujuland.pagesperso-orange.fr/</a><br>
<a class="moz-txt-link-freetext" href="http://pissobi-lacassagne.pagesperso-orange.fr/">http://pissobi-lacassagne.pagesperso-orange.fr/</a><br>
<hr>
<small>U.buntu 12.04 | G.ramps 3.4.6-1 | H.arbour 3.2.0dev
(2014-01-27 14:04) | HbIDE (Rev.279) | Five.Linux (r138) |
Hw.Gui (2217)</small>
<hr></div>
</body>
</html>
|
|
From: Alain A. <ala...@wa...> - 2014-01-31 12:39:48
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 31/01/2014 11:30, Alexander S.Kresin
a écrit :<br>
</div>
<blockquote cite="mid:52E...@be..." type="cite">
<pre wrap="">What about:
hwg_SetAppLocale( "CP1251" )
hb_cdpSelect( "FRWIN" )
SetDataCP( "FR850")</pre>
</blockquote>
No more good (FRWIN is not a know CP)<br>
<br>
After searching in harbour source, I found that ISO-8859-1 is bad
and ISO8859-1 is good instead<br>
<br>
Setting applocale to ISO8859-1 does the trick for gets, but now,
impossible to have dbf fields or menu strings correctly displayed.
(see hardcopy). The hardcopy is for :<br>
<br>
hwg_SetAppLocale( "ISO8859-1" )<br>
hb_cdpSelect( "CP850" )<br>
SetDataCP( "FR850")<br>
<br>
It seems that SetAppLocale is the master, and all the values we can
set for cdp or datacp are not executed.<br>
<br>
A+<br>
<div class="moz-signature">-- <br>
<hr>
Alain Aupeix<br>
<a class="moz-txt-link-freetext" href="http://jujuland.pagesperso-orange.fr/">http://jujuland.pagesperso-orange.fr/</a><br>
<a class="moz-txt-link-freetext" href="http://pissobi-lacassagne.pagesperso-orange.fr/">http://pissobi-lacassagne.pagesperso-orange.fr/</a><br>
<hr>
<small>U.buntu 12.04 | G.ramps 3.4.6-1 | H.arbour 3.2.0dev
(2014-01-27 14:04) | HbIDE (Rev.279) | Five.Linux (r138) |
Hw.Gui (2217)</small>
<hr></div>
</body>
</html>
|
|
From: Alexander S.K. <al...@be...> - 2014-02-03 09:52:22
|
Alain Aupeix writes: >> hwg_SetAppLocale( "CP1251" ) >> hb_cdpSelect( "FRWIN" ) >> SetDataCP( "FR850") > No more good (FRWIN is not a know CP) FRWIN is a known cp - see the harbour/src/codepage/cpfrwin.c Probably, you forgot to request it: REQUEST HB_CODEPAGE_FRWIN REQUEST HB_CODEPAGE_FR850 > > After searching in harbour source, I found that ISO-8859-1 is bad and > ISO8859-1 is good instead > > Setting applocale to ISO8859-1 does the trick for gets, but now, > impossible to have dbf fields or menu strings correctly displayed. (see > hardcopy). The hardcopy is for : > > hwg_SetAppLocale( "ISO8859-1" ) > hb_cdpSelect( "CP850" ) > SetDataCP( "FR850") > > It seems that SetAppLocale is the master, and all the values we can set > for cdp or datacp are not executed. > Iy you use the ISO8859-1, you, probably, need to use hb_cdpSelect( "FRISO" ), because this Harbour's codepage corresponds it. Of course, don't forget to include REQUEST HB_CODEPAGE_FRISO REQUEST HB_CODEPAGE_FR850 in this case. Regards, Alexander. |