Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Need advices regarding the strings (str, unicode, coding) used asinterface for an external library.

Reply
Thread Tools

Need advices regarding the strings (str, unicode, coding) used asinterface for an external library.

 
 
jmfauth
Guest
Posts: n/a
 
      11-22-2010
I'm planning to build an external lib. This lib will exchange
a lot of strings between the lib and the "core Python code"
of applications.

I wish this lib to be modern, 100% unicode compliant. It will
be developped for Python 2.7 and for Python 3. In an early
phase, technically, it will be developed on Python 2.7 before
Python 3, probably 3.2.

Two options for the strings interface.

a) Pure unicode, that means only type 'unicode' in Python 2.7
and only type 'str' in Python 3.

Similar to the Python io module.

b) Like a) plus ascii and utf-8 encoded type 'str' to keep
some kind of retro compatibility. This lib will anyway
work in a "unicode mode", so the ascii and the encoded
utf-8 str's have to be converted into "unicode".

I'm very comfortable with all this coding stuff
and aware of the pros and cons of each solutions.

My favourite solution is clearly on the a) side.

Advices and comments are welcome. Thanks in advance.
 
Reply With Quote
 
 
 
 
Terry Reedy
Guest
Posts: n/a
 
      11-23-2010
On 11/22/2010 3:25 PM, jmfauth wrote:
> I'm planning to build an external lib. This lib will exchange
> a lot of strings between the lib and the "core Python code"
> of applications.


Are you planning to exchange indirectly via disk files or directly via
memory buffers?

This pretty much amounts to whether the library will interface with
Python-only or with anything.

Also, what OSes? If 'all', you need to be able to work with both 2 and 4
byte unicodes.

--
Terry Jan Reedy

 
Reply With Quote
 
 
 
 
jmfauth
Guest
Posts: n/a
 
      11-23-2010
Thanks for the reply. Subject closed.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need some advices regarding JNI JPractitioner Java 6 07-25-2006 08:23 AM
Need your advices =?utf-8?B?5rW36aOO?= Java 10 04-17-2006 10:26 PM
Need advices on my codes Danny Ni ASP .Net 0 11-11-2004 04:51 PM
Need advices for exam 70-306 LoveGarfield MCSD 3 09-21-2003 11:06 AM
need advices : intranet archecture design Gildas Garcia ASP .Net 0 07-04-2003 07:08 PM



Advertisments