Re: [l10n-dev] Conversion of LocaleID into codepage

2009-04-08 Thread tora - Takamichi Akiyama

Hi,

Eike Rathke wrote:

That sounds like a much more complete implementation than what we
currently have. I suggest you submit a patch for the 'basic' module.


That has been just submitted as issue 100953.

Regards,
Tora


On Friday, 2009-03-13 16:25:59 +0900, tora - Takamichi Akiyama wrote:

Before looking into the answer about LCID and codepage, I would like
to tell you about a small achievement. I have preliminarily implemented
the following OpenOffice.org Basic functions for users who want to
migrate from Excel VBA to OpenOffice.org:
 - StrConv
 - LenB
 - MidB
 - RightB
 - LeftB



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



Re: [l10n-dev] Conversion of LocaleID into codepage

2009-04-08 Thread Eike Rathke
Hi tora,

On Wednesday, 2009-04-08 21:53:05 +0900, tora - Takamichi Akiyama wrote:

 That sounds like a much more complete implementation than what we
 currently have. I suggest you submit a patch for the 'basic' module.

 That has been just submitted as issue 100953.

Thanks!

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to the e...@sun.com account, which I use for
 mailing lists only and don't read from outside Sun. Use er...@sun.com Thanks.


pgpYQ63usE8mW.pgp
Description: PGP signature


Re: [l10n-dev] Conversion of LocaleID into codepage

2009-03-16 Thread Eike Rathke
Hi tora,

On Friday, 2009-03-13 16:25:59 +0900, tora - Takamichi Akiyama wrote:

 Before looking into the answer about LCID and codepage, I would like
 to tell you about a small achievement. I have preliminarily implemented
 the following OpenOffice.org Basic functions for users who want to
 migrate from Excel VBA to OpenOffice.org:
  - StrConv
  - LenB
  - MidB
  - RightB
  - LeftB

 The implementation of mine differs from the one done in the issue 85036
 which uses an array of Bytes while the one of mine uses ByteString for the
 texts converted with StrConv( string, FromUnicode ). Furthermore, other
 related functions - LenB, MidB, RightB, and LeftB - are implemented with
 templateclass T where T will be assigned with String and ByteString.
 Additionally, ImpGetByteString() beside ImpGetString() in basic/source/sbx
 has been added. So calculations such as concatenation and comparison are
 also supported.

 Are you or someone else interested in it? If so, how shall I proceed?

That sounds like a much more complete implementation than what we
currently have. I suggest you submit a patch for the 'basic' module.

 I am looking into your comments on the LCID and codepage.

You would have to implement a mapping from LCID values to their default
codepage, this would be something similar to svx/inc/countryid.hxx and
svx/source/msfilter/countryid.cxx. Then for the codepage value you could
obtain the rtl_TextEncoding with a call to
rtl_getTextEncodingFromWindowsCodePage(), see rtl/tencinfo.h

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to the e...@sun.com account, which I use for
 mailing lists only and don't read from outside Sun. Use er...@sun.com Thanks.


pgp1zFHoJ1zWS.pgp
Description: PGP signature


Re: [l10n-dev] Conversion of LocaleID into codepage

2009-03-11 Thread Eike Rathke
Hi,

On Tuesday, 2009-03-10 13:37:23 +0100, Eike Rathke wrote:

 Medium answer: You don't need it. Given the conversions enumerated at
 http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.strings.strconv.aspx
 there are no codepages involved.

That is incomplete and misleading. The enumeration isn't one but a bit
mask instead, and vbUnicode and vbFromUnicode are not mentioned at all,
but the issue's patch attempts to implement them.

 I think the implementation of the patch attached to
 http://qa.openoffice.org/issues/show_bug.cgi?id=85036 is completely
 wrong for the cases of VbStrConv.Wide and VbStrConv.Narrow.

Sorry, I was mislead and wrong on this.

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to the e...@sun.com account, which I use for
 mailing lists only and don't read from outside Sun. Use er...@sun.com Thanks.


pgpgiSyxQT2x3.pgp
Description: PGP signature


Re: [l10n-dev] Conversion of LocaleID into codepage

2009-03-10 Thread Eike Rathke
Hi tora,

On Tuesday, 2009-03-10 00:25:35 +0900, tora - Takamichi Akiyama wrote:

 Is there any code in the OpenOffice.org source code to convert
 LocaleId (LCID) into language id (codepage)?

Short answer: no to my knowledge.

Medium answer: You don't need it. Given the conversions enumerated at
http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.strings.strconv.aspx
there are no codepages involved. For details see below.

Long answer following:

First, a codepage is not a language ID. It is an ID for text encoding,
which only in some cases is related to a language. e.g., the common
cp437 or Windows-1252 are language neutral.

 The relation between them seems available at [1].

That lists _default_ codepages, which may or may not match reality.

 VBA's StrConv() method [2] takes LocaleID as a third parameter
 while OpenOffice.org's internal string encoding conversion
 methods take language type [3].

The functionality StrConv() provides is not conversion between text
encodings, but tranliterations instead.

 So, I was wondering if we had
 already implemented such a translation function.

Yes ;)  it is transliteration and already used in the patch for
StrConv().

 Is there any idea to implement the StrConv() macro function which
 can work on not only Window but also other operating systems?

I think the implementation of the patch attached to
http://qa.openoffice.org/issues/show_bug.cgi?id=85036 is completely
wrong for the cases of VbStrConv.Wide and VbStrConv.Narrow. What the
patch does is conversion between OString and OUString and vice versa,
which is the only reason a rtl_TextEncoding is needed. But this is
wrong, it should do transliteration using HALFWIDTH_FULLWIDTH and
FULLWIDTH_HALFWIDTH instead. Wide and Narrow are not related to the
number of bytes per character used ;-)

I'll reopen the issue and add a comment.

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to the e...@sun.com account, which I use for
 mailing lists only and don't read from outside Sun. Use er...@sun.com Thanks.


pgp9MBDUMxJ4k.pgp
Description: PGP signature