List Info

Thread: open a text file encoded with a given character set




open a text file encoded with a given character set
user name
2007-01-04 08:38:03
Cedric Bosdonnat wrote:
> Hi all,
> 
> It's really hard to find informations on the options to
give to the 
> 'Text (encoded)' filter. I finally found out the
information needed to 
> import the file with the proper character set.
> 
>   1/ I created a snippet to explain the solution
>   2/ Could it be possible to complete the wiki with the
list of the 
> possible character sets, and the filter options
details. ?

that is  good point, we need a place where exactly this kind
of 
implementation details can be described.

A further option from my point of view can be to specify a
multiple 
inheritance interface and define for each implementation a
new service. 
The service represents a special version or implemenation of
this 
interface which can be instantiated. In the service
documentation the 
possible values of the attributes or function parameters can
be 
described specific for this filter.

There are probably more ways to document this. But it is
independent 
where it is documented, important is that it is documented.

We have more places in the API where it is hard to find the
possible 
values for example for the parameters. I would like to
encourage all API 
designer to keep this in mind. Other people will use the
APIs and need 
this information and it is important to find them easily.

With the OO wiki we have a good possibility to extend the
IDL docu with 
links into the wiki where more and maybe changing docu can
be found. The 
wiki is easy to change and for example a growing lists of
possible 
parameter values can be easy adapted.

Juergen

> 
> Thanks,
> Cedric
> 
> 
>
------------------------------------------------------------
------------
> 
> <?xml version="1.0"?>
> <!--
> $RCSfile: $
> last change: $Revision: $ $Author: $ $Date: $
> 
> (c)2003 by the copyright holders listed with the
author-tags.
> If no explicit copyright holder is mentioned with a
certain author,
> the author him-/herself is the copyright holder. All
rights reserved.
> 
> Public Documentation License Notice:
> 
> The contents of this Documentation are subject to the
> Public Documentation License Version 1.0 (the
"License");
> you may only use this Documentation if you comply with
> the terms of this License. A copy of the License is
> available at http://ww
w.openoffice.org/licenses/PDL.html
> 
> The Original Documentation can be found in the CVS
archives
> of openoffice.org at the place specified by RCSfile: in
this header.
> 
> The Initial Writer(s) of the Original Documentation are
listed
> with the author-tags below.
> 
> The Contributor(s) are listed with the author-tags
below
> without the marker for being an initial author.
> 
> All Rights Reserved.
> -->
> 
> <snippet language="OOBasic"
application="Writer">
> 
> <keywords>
> 	<keyword>Text (encoded)</keyword>
> 	<keyword>FilterOptions</keyword>
> </keywords>
> 
> <authors>
> 	<author id="cedricbosdo"
initial="true"
email="cedric.bosdonnat.ooofree.fr"
copyright="2007 (c) StarXpert">Cedric
Bosdonnat</author>
> </authors>
> 
> <question heading="Importing a plain text
encoded with a given character set">How to import a
plain text file encoded with a given character set
> 
> 
> <p>Simply suppose we need to import MyTest.txt
which is encoded in IBM850, also knwon as cp850.</p>
> </question>
> 
> <answer>
> <p>For this, we need to use the &apos;Text
(encoded)&apos; filter and configure it properly as
shown by the code snippet.</p>
> <p>The possible character set codes are all
listed on this page: http://equalitylearning.org/~robertz/oo_e
ncoding_indexes.html</p>
> <listing>	Dim oMediaDescriptor(1) as new {see
com.sun.star.beans.PropertyValue}
> 	
> 	sFileUrl = convertToUrl( &quot;H:My
Test.txt&quot; )
> 	
> 	oMediaDescriptor(0).name =
&quot;FilterName&quot;
> 	oMediaDescriptor(0).value = &quot;Text
(encoded)&quot;
> 	oMediaDescriptor(1).name =
&quot;FilterOptions&quot;
> 	oMediaDescriptor(1).value =
&quot;IBM_850&quot;
>     oDoc = StarDesktop.loadComponentFromURL(sFileURL,
&quot;_blank&quot;, 0,
oMediaDescriptor)</listing>
> </answer>
> 
> <versions>
> 	<version number="2.0.x"
status="tested"/>
> </versions>
> 
> <operating-systems>
> <operating-system name="All"/>
> </operating-systems>
> 
> <changelog>
> 	<change author-id="cedricbosdo"
date="2007-01-03">Initial
version</change>
> </changelog>
> 
> </snippet>
> 
> 
>
------------------------------------------------------------
------------
> 
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
> For additional commands, e-mail: dev-helpapi.openoffice.org

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )