#1120: UTF8-Bytestring Pango interface.
-----------------------------+----------------------------------------------
Reporter: guest | Owner: axel
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Pango bindings | Version: 0.9.12
Resolution: | Keywords:
-----------------------------+----------------------------------------------
Comment (by duncan):
Replying to [comment:5 axel]:
> Duncan,
>
> it sounds as if you are suggesting an additional interface that re-
implements every existing Pango function using a PackedString such that
the UTF8 <-> Unicode conversion is still done by our Pango binding. If
you'd actually use ByteString where every element presumably occupies 8
bits, how would you store Unicode characters in it?
Yes, but using a Haskell type that is specifically designed to represent
Unicode text. Internally it'd almost certainly use UTF-8 and provide fast
conversion to UTF-8 encoded memory buffers.
It should not be necessary to have two full implementations of all
functions since one set should be easy to implement in terms of the other.
> What JPB suggests is an interface using raw UTF8 strings that avoids the
overhead of our Pango interface. I guess he would use some packed
representation such as ByteString, but I'm not sure.
Right, and I'm suggesting something similar but using a type that is
designed for the purpose rather than (ab)using ByteString to represent
unicode text.
> I don't have a problem adding both interfaces. However, to ensure that
"normal" people are not confused, could we have these additional APIs in
Pango.PackedString.* and Pango.ByteString.* or similar?
That would make sense.
--
Ticket URL: <http://hackage.haskell.org/trac/gtk2hs/ticket/1120#comment:6>
Gtk2Hs <http://haskell.org/gtk2hs/>
The Gtk2Hs project
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Gtk2hs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel