Re: [api-dev] UTF-8 from Ubuntu not supported by OOoBasic on Windows?

2011-02-14 Thread Stephan Bergmann

On 02/14/11 11:09, Cor Nouws wrote:

Take a text file with special characters (e.g. Extréme)
Saving on Ubuntu in gedit, the default text encoding is UTF-8.

Reading the file in OOo Basic with 'Open sFile for Input' and showing
the text is OK.


I assume Basic's Open uses as encoding for the given file the value of 
osl_getThreadTextEncoding (which is something like OOo's abstraction of 
the text encoding in use in the system, which typically happens to be 
UTF-8 in Ubuntu, but MS-1252 on a Western European Windows; the latter 
in turn is very similar to ISO 8859-1 and ISO 8859-15).  No idea if you 
can tell Basic to use a specific encoding for a given file.


-Stephan


But reading the same file with OOoBasic on Windows, does not show the
special character properly.
If I save as ISO-8859-15 in gedit, it does show fine on Windows.
But of course (?) not on Ubuntu.

Is this a general OS problem with the text-encoding? Does OOoBasic do
something wrong?


-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] UTF-8 from Ubuntu not supported by OOoBasic on Windows?

2011-02-14 Thread Cor Nouws

Hi Stephan,

Stephan Bergmann wrote (14-02-11 11:27)


I assume Basic's Open uses as encoding for the given file the value of
osl_getThreadTextEncoding (which is something like OOo's abstraction of
the text encoding in use in the system, which typically happens to be
UTF-8 in Ubuntu, but MS-1252 on a Western European Windows; the latter
in turn is very similar to ISO 8859-1 and ISO 8859-15). No idea if you
can tell Basic to use a specific encoding for a given file.


There is no argument available in Basic.

Searching for osl_getThreadTextEncoding leads me to OStringToOUString.

Grepping for that, I see quite some entries as e.g.
   rtl::OStringToOUString( aString, RTL_TEXTENCODING_UTF8 )
so I guess in the code it could be possible.

OK, thanks for the pointer anyway ;-)

Cor


--
 - giving openoffice.org its foundation :: The Document Foundation -


-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] UTF-8 from Ubuntu not supported by OOoBasic on Windows?

2011-02-14 Thread Noelson Duarte
Hi,

You can use api streams like XTextInputStream and method setEncoding.

--
Noelson


2011/2/14 Cor Nouws oo...@nouenoff.nl

 Hi Stephan,

 Stephan Bergmann wrote (14-02-11 11:27)


  I assume Basic's Open uses as encoding for the given file the value of
 osl_getThreadTextEncoding (which is something like OOo's abstraction of
 the text encoding in use in the system, which typically happens to be
 UTF-8 in Ubuntu, but MS-1252 on a Western European Windows; the latter
 in turn is very similar to ISO 8859-1 and ISO 8859-15). No idea if you
 can tell Basic to use a specific encoding for a given file.


 There is no argument available in Basic.

 Searching for osl_getThreadTextEncoding leads me to OStringToOUString.

 Grepping for that, I see quite some entries as e.g.
   rtl::OStringToOUString( aString, RTL_TEXTENCODING_UTF8 )
 so I guess in the code it could be possible.

 OK, thanks for the pointer anyway ;-)


 Cor


 --
  - giving openoffice.org its foundation :: The Document Foundation -


 -
 To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
 For additional commands, e-mail: dev-h...@api.openoffice.org