[omniORB] omniORBpy: Problem with IDL string type and iso-8859 encoding ...

mcharest at sogetel.net mcharest at sogetel.net
Tue May 17 23:18:26 BST 2005


Hi, 

* I have created a very simple test interface as follows:
module Bottin {
	// Types:
	struct Record {
		string matricule;
		string nom;
		string prenom;
		string password;
		string annee;
		string couriel;
	};

	typedef sequence <Record> StudentList;

	// Operations:
	interface Etudiant {
		void subscribe(in Record rec);
	};
};¨

The interface compiles fine with omniidl.  All CORBA calls between my client and
server application function correctly when using only ASCII values for my string
types.

Problem:
---------
* When I assign ISO-8859 encoded values (i.e. French accents) to my string 
attributes in my struct type (Record), I receive the following error:

> "C:\Program Files\Python24\python.exe" bottin_gui.py 
Exception in Tkinter callback
Traceback (most recent call last):
  File "bottin_gui.py", line 34, in suscribe
    objn.subscribe(r)
  File "H:\bottin_idl.py", line 126, in subscribe
    return _omnipy.invoke(self, "subscribe", _0_Bottin.Etudiant._d_subscribe, args)
BAD_PARAM: Minor: BAD_PARAM_WrongPythonType, COMPLETED_NO.

Reasoning:
------------
* I have consulted the omniORBpy User Guide which states that the ORB uses, 
by default, a ISO-8859 code set.

* My Python string literals are being interpreted fine as ISO-8859 strings because
I have set the magic number string in my source files (# -*- coding: iso-8859-1 -*-).

* I have temporarily changed my IDL string declarations to wstring types (in
conjunction with a configuration option for the ORB to UTF-8 ... and the 
CORBA error is eliminated !

* BUT, my problem remains as I am working with a Database back-end for 
my solution that cannot support UTF-8 encoding !  Hence, I am back
to square 1.

Basic Inquiry:
----------------
* Do simple IDL string type declarations support ISO-8859 (or must I use 
wstring and go with UTF-8) ?  

Configuration:
----------------
OS: Windows XP SP2
Python: 2.4
omniORBpy 2.6 (win32 pre-compiled binaries)

* Any suggestions or comments would be most appreciated
Regards, 
Michel 





More information about the omniORB-list mailing list