Return-Path: X-Original-To: apmail-openoffice-dev-archive@www.apache.org Delivered-To: apmail-openoffice-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6CC3010E78 for ; Tue, 15 Oct 2013 14:03:55 +0000 (UTC) Received: (qmail 49732 invoked by uid 500); 15 Oct 2013 14:03:48 -0000 Delivered-To: apmail-openoffice-dev-archive@openoffice.apache.org Received: (qmail 48782 invoked by uid 500); 15 Oct 2013 14:03:46 -0000 Mailing-List: contact dev-help@openoffice.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openoffice.apache.org Delivered-To: mailing list dev@openoffice.apache.org Received: (qmail 47347 invoked by uid 99); 15 Oct 2013 14:03:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2013 14:03:44 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of stevanovicvladislav@gmail.com designates 209.85.212.179 as permitted sender) Received: from [209.85.212.179] (HELO mail-wi0-f179.google.com) (209.85.212.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2013 14:03:38 +0000 Received: by mail-wi0-f179.google.com with SMTP id hm4so3417278wib.6 for ; Tue, 15 Oct 2013 07:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=rOxXa2jLtA7ZxJmk3tbarhSTqZgL/Qx1myVb06dcx0M=; b=evzBQCehEX2Oy8eHOuJ5mctmY85NCzRZpM90OyIeD7y7aef/gXFuNOr1IswfaEs4/s /9wo3Utp6IZqfWe0ecQQVE27GKwgvpNMAXziGu88Usuwg1yaw2cx+mYhj6VW+uYWOVDv 7LafPIWpmuBAHwIWBCyGiwJLygMM1NUK0aRyoMBgX5cI4V1YnMZzibmxpgpwh7q2Eys4 hYS2zG7FavjyBYUPSaL7pBTRmnhb76G+WkZ29TaXcHB5Tt1USjWyJ2gqmTT+MW7YO6G3 fX8C1iVsHIg9mHZIWIdsEsN7P5DQeasn20mwPC8/IDM9mKT5f1zK5FM0xupLOS5BWESP Cz4g== X-Received: by 10.180.100.6 with SMTP id eu6mr3126414wib.0.1381845798007; Tue, 15 Oct 2013 07:03:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.164.2 with HTTP; Tue, 15 Oct 2013 07:02:37 -0700 (PDT) In-Reply-To: <525CEC63.6040608@pmgroup.be> References: <525CEC63.6040608@pmgroup.be> From: Vladislav Stevanovic Date: Tue, 15 Oct 2013 16:02:37 +0200 Message-ID: Subject: Re: BASIC and UTF-8 To: dev@openoffice.apache.org Content-Type: multipart/alternative; boundary=f46d044283d6ecb94a04e8c80bd7 X-Virus-Checked: Checked by ClamAV on apache.org --f46d044283d6ecb94a04e8c80bd7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Maybe will be easier for better understunding each other is to first look here: http://forum.openoffice.org/en/forum/viewtopic.php?f=3D20&t=3D58328 Regards Wlada 2013/10/15 Fernand Vanrie > Vladislav , > > In Belgium we have to deal with at least 2 languages Dutch and French who > have also a lot non asci characters, we use extenifly Basic and some time= s > hwe have to decode some text to UTF-8 who works and we decode the stream > plese find below some code to encode a stream before insertion in a > document > > hope it helps > > Greetz Fernand > oPipe =3D createUNOService ("com.sun.star.io.Pipe") > oTextOutputStream =3D createUNOService ("com.sun.star.io.** > TextOutputStream") > oTextOutputStream.**setOutputStream(oPipe) > oTextOutputStream.setEncoding(**"UTF-8") '"Windows-1252") > > szone =3D "some tekst with &=E0=B9=89"''((=E0=B8=87=E0=B8=87=E0=B8=87=E0= =B9=88=E0=B9=88=E0=B9=88!! non asci character > 'print szone > oTextOutputStream.writeString(**szone) > ' at current viewcursor positiong > InsertViaStream(opipe) > > sub InsertViaStream(oInputStream as Any) > oStorageFac =3D createUnoService("com.sun.**star.embed.StorageFactory") > oStorage =3D oStorageFac.createInstance > oStream =3D oStorage.openStreamElement("**ms777", com.sun.star.embed.= ** > ElementModes.WRITE) > > 'now pump the inputstream to the stream > oPump =3D createUNOService ("com.sun.star.io.Pump") > oPump.setInputStream(**oInputStream) > oPump.setOutputStream(oStream) > oPump.start() > > while oInputStream.available()>0 > wait(50) > wend > oStream.flush > oStream.closeOutput > oStream.dispose > 'open the stream again, now for seekable reading > oStream =3D oStorage.openStreamElement("**ms777", com.sun.star.embed.** > ElementModes.SEEKABLEREAD) > dim oProps(1) as new com.sun.star.beans.**PropertyValue > oProps(0).Name =3D "InputStream" > oProps(0).Value =3D ostream > oProps(1).Name =3D "FilterName" > oProps(1).VAlue =3D "HTML (StarWriter)" > > > Dim oInsertCursor As Object > if wat =3D "Cell" then > oInsertCursor =3D oVC.cell.**createTextCursorByRange(oVC,**false) > elseif wat =3D "Frame" then > oInsertCursor =3D oVC.TextFrame.**createTextCursorByRange(oVC,**false= ) > elseif wat =3D "Doc" then > oInsertCursor =3D oVC.text.**createTextCursorByRange(oVC,**false) > endif > oInsertCursor.**InsertDocumentFromURL("" , oProps()) > > opipe.flush > opipe.closeinput > ostorage.dispose > ostream =3D nothing > end sub > > Hello, >> As I can see, there is a lot of people who are using BASIC for macros. A= nd >> I too. >> Problem is next: does anybody developing Basic? >> Problem 1: for all who want to deal with characters outside of English >> language we have big problem, for example, with print function. I can no= t >> export Cyrillic characters. >> Problem 2: This is an office suit. Problem is when I want export some da= ta >> in a brand new .xml document. I can not create this xml document without >> meta files in zipped file. >> If I look on OO forum, there are majority of users who deal with Basic. = If >> this is reality, what is problem for little polishing for Basic? >> >> Regards, >> Wlada >> >> > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: dev-unsubscribe@openoffice.**apache.org > For additional commands, e-mail: dev-help@openoffice.apache.org > > --f46d044283d6ecb94a04e8c80bd7--