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

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Cor Nouws
Hi *,

This is about text encoding and special characters on Ubuntu and Windows


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.
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?

Thanks,
Cor



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Stephan Bergmann-2
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Noelson Duarte-2
Hi,

You can use api streams like XTextInputStream and method setEncoding.

--
Noelson


2011/2/14 Cor Nouws <[hidden email]>

> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

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

Cor Nouws
Hi Noelson,

Noelson Duarte wrote (14-02-11 18:42)

> You can use api streams like XTextInputStream and method setEncoding.

Thank you, will have a look into that :-)

Cor


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]