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.

Attachment: pgp9MBDUMxJ4k.pgp
Description: PGP signature

Reply via email to