comp.lang.ada
 help / color / mirror / Atom feed
* gtkada: CAIRO_STATUS_INVALID_STRING
@ 2015-03-19  0:50 hreba
  2015-03-19  8:01 ` jan.de.kruyf
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hreba @ 2015-03-19  0:50 UTC (permalink / raw)


I concatenate some strings created with Integer'Image and print them to 
the screen with Cairo.Show_Text. A subsequent call to Cairo.Status 
returns CAIRO_STATUS_INVALID_STRING. Calling Cairo.Show_Text with String 
literals works fine.

The comments of Show_Text subprogram say that the argument shall be a
"NUL-terminated string of text encoded in UTF-8, or Null_Ptr". Appending 
ASCII.NUL did not help. So what can I do to make the String UTF-8?

I am using the actual Ubuntu repository for Linux and GNAT GPL 2012 for 
Windows, both with libgtkada2.24.
-- 
Frank Hrebabetzky		+55 / 48 / 3235 1106
Florianopolis, Brazil


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gtkada: CAIRO_STATUS_INVALID_STRING
  2015-03-19  0:50 gtkada: CAIRO_STATUS_INVALID_STRING hreba
@ 2015-03-19  8:01 ` jan.de.kruyf
  2015-03-19  8:50 ` Dmitry A. Kazakov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jan.de.kruyf @ 2015-03-19  8:01 UTC (permalink / raw)


On Thursday, March 19, 2015 at 2:50:56 AM UTC+2, hreba wrote:
> I concatenate some strings created with Integer'Image and print them to 
> the screen with Cairo.Show_Text. A subsequent call to Cairo.Status 
> returns CAIRO_STATUS_INVALID_STRING. Calling Cairo.Show_Text with String 
> literals works fine.
> 
> The comments of Show_Text subprogram say that the argument shall be a
> "NUL-terminated string of text encoded in UTF-8, or Null_Ptr". Appending 
> ASCII.NUL did not help. So what can I do to make the String UTF-8?
> 
> I am using the actual Ubuntu repository for Linux and GNAT GPL 2012 for 
> Windows, both with libgtkada2.24.
> -- 
> Frank Hrebabetzky		+55 / 48 / 3235 1106
> Florianopolis, Brazil


google is your friend!!

http://lists.adacore.com/pipermail/gtkada/2003-March/002102.html

cheers,
j.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gtkada: CAIRO_STATUS_INVALID_STRING
  2015-03-19  0:50 gtkada: CAIRO_STATUS_INVALID_STRING hreba
  2015-03-19  8:01 ` jan.de.kruyf
@ 2015-03-19  8:50 ` Dmitry A. Kazakov
  2015-03-19  9:08 ` J-P. Rosen
  2015-03-21 19:29 ` hreba
  3 siblings, 0 replies; 5+ messages in thread
From: Dmitry A. Kazakov @ 2015-03-19  8:50 UTC (permalink / raw)


On Wed, 18 Mar 2015 21:50:51 -0300, hreba wrote:

> The comments of Show_Text subprogram say that the argument shall be a
> "NUL-terminated string of text encoded in UTF-8, or Null_Ptr". Appending 
> ASCII.NUL did not help. So what can I do to make the String UTF-8?

String is UTF-8 so long you use ASCII codes only. Should you use Latin-1
you must convert to UTF-8.

(NUL is added by bindings when the argument String and not char_array or
chars_ptr)

> I am using the actual Ubuntu repository for Linux and GNAT GPL 2012 for 
> Windows, both with libgtkada2.24.

2.24 is way outdated. The actual version GNAT GPL supports is 3.8. There
were not so many changes regarding Cairo, though text rendering works
slightly different in 3.x especially when connected with Cairo context
transformations. I don't remember details.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gtkada: CAIRO_STATUS_INVALID_STRING
  2015-03-19  0:50 gtkada: CAIRO_STATUS_INVALID_STRING hreba
  2015-03-19  8:01 ` jan.de.kruyf
  2015-03-19  8:50 ` Dmitry A. Kazakov
@ 2015-03-19  9:08 ` J-P. Rosen
  2015-03-21 19:29 ` hreba
  3 siblings, 0 replies; 5+ messages in thread
From: J-P. Rosen @ 2015-03-19  9:08 UTC (permalink / raw)


Le 19/03/2015 01:50, hreba a écrit :
> So what can I do to make the String UTF-8?

package Ada.Strings.UTF_Encoding

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gtkada: CAIRO_STATUS_INVALID_STRING
  2015-03-19  0:50 gtkada: CAIRO_STATUS_INVALID_STRING hreba
                   ` (2 preceding siblings ...)
  2015-03-19  9:08 ` J-P. Rosen
@ 2015-03-21 19:29 ` hreba
  3 siblings, 0 replies; 5+ messages in thread
From: hreba @ 2015-03-21 19:29 UTC (permalink / raw)


On 03/18/2015 09:50 PM, hreba wrote:
Thanks to all for your hints, it is working now.
-- 
Frank Hrebabetzky		+55 / 48 / 3235 1106
Florianopolis, Brazil


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-21 19:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19  0:50 gtkada: CAIRO_STATUS_INVALID_STRING hreba
2015-03-19  8:01 ` jan.de.kruyf
2015-03-19  8:50 ` Dmitry A. Kazakov
2015-03-19  9:08 ` J-P. Rosen
2015-03-21 19:29 ` hreba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox