Issue 85036 - VBA: strconv function is not supported
Summary: VBA: strconv function is not supported
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: pflin
QA Contact: Unknown
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-07 05:17 UTC by pflin
Modified: 2017-05-20 09:32 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch for implementation (5.29 KB, text/plain)
2008-02-28 05:51 UTC, pflin
no flags Details
test document (66.00 KB, text/plain)
2008-02-28 05:51 UTC, pflin
no flags Details
test document for QA (7.19 KB, text/plain)
2008-04-24 03:50 UTC, pflin
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description pflin 2008-01-07 05:17:01 UTC
In VBA, the StrConv function returns a string converted as specified.

For example:
    StrConv ("tech on the net", 1) 	'would return "TECH ON THE NET"
    StrConv ("TECH ON THE NET", 2) 	'would return "tech on the net"
    StrConv ("TECH ON THE NET", 3) 	'would return "Tech On The Net"

the StrConv function is not supported in OOo basic
Comment 1 pflin 2008-01-07 05:17:23 UTC
will add to npower10
Comment 2 pflin 2008-02-28 05:51:34 UTC
Created attachment 51771 [details]
patch for implementation
Comment 3 pflin 2008-02-28 05:51:53 UTC
Created attachment 51772 [details]
test document
Comment 4 pflin 2008-02-28 05:52:33 UTC
The patch is added to cws npower10
Comment 5 noel.power 2008-04-22 13:22:54 UTC
fong mark as fixed if it is so ( which I presume it is )
Comment 6 pflin 2008-04-22 14:33:52 UTC
fixed in npower10
Comment 7 pflin 2008-04-24 03:50:18 UTC
Created attachment 53156 [details]
test document for QA
Comment 8 sled10guy 2008-06-16 22:47:19 UTC
As shown in the following result log the StrConv function succeeded in the
following CWS build:

O3-build-2457-npower10-install_set


Log File Results:

Test run started : 06/16/2008 03:39:58 PM
BEGIN StrConv
 TEST START : Test StrConv function
  ITEM Assertion OK : Converts the string to uppercase characters:ABC EFG HIJ
  ITEM Assertion OK : Converts the string to lowercase characters:abc efg hij
  ITEM Assertion OK : Converts the first letter of every word in string to
uppercase:Abc Efg Hij
  ITEM Assertion FAIL : Converts narrow (single-byte) characters in string to wide
  ITEM Assertion FAIL : Converts wide (double-byte) characters in string to
narrow (single-byte) characters.£Ã£Â£Ã£Ä£ÅVB¥ì¥¹¥­¥å©`
  ITEM Assertion FAIL : Converts Hiragana characters in string to Katakana
characters..¤Ã¤Ê¤Ã¤ã¤ó
  ITEM Assertion FAIL : Converts Katakana characters in string to Hiragana
characters..¥åʥåã¥ó
  ITEM Assertion FAIL : Converts the string from Unicode, the lenght is : 15
  ITEM Assertion OK : Converts the string to Unicode: Éú£ÊÃABC
 TEST OK : Test StrConv function
END  StrConv
Test run finished : 06/16/2008 03:39:58 PM
Comment 9 sled10guy 2008-06-25 00:19:01 UTC
It looks like the Unicode Test passes on the Windows machine whereas the Linux
build failed:

ie...

  ITEM Assertion OK : Converts the string from Unicode, the lenght is : 9


Verified in the following npower10 build with the updated test document:

Win-XP2-503-npower10-install_set.zip

Test run started : 06/24/2008 05:14:23 PM

BEGIN StrConv

 TEST START : Test StrConv function

  ITEM Assertion OK : Converts the string to uppercase characters:ABC EFG HIJ

  ITEM Assertion OK : Converts the string to lowercase characters:abc efg hij

  ITEM Assertion OK : Converts the first letter of every word in string to
uppercase:Abc Efg Hij

  ITEM Assertion FAIL : Converts narrow (single-byte) characters in string to wide

  ITEM Assertion FAIL : Converts wide (double-byte) characters in string to
narrow (single-byte) characters.£Ã£Â£Ã£Ä£ÅVB¥ì¥¹¥­¥å©`

  ITEM Assertion FAIL : Converts Hiragana characters in string to Katakana
characters..€Ã€Ê€Ãۋۗ

  ITEM Assertion FAIL : Converts Katakana characters in string to Hiragana
characters..¥åʥåã¥ó

  ITEM Assertion OK : Converts the string from Unicode, the lenght is : 9

  ITEM Assertion OK : Converts the string to Unicode: Éú£ÊÃABC

 TEST OK : Test StrConv function

END  StrConv

Test run finished : 06/24/2008 05:14:23 PM


Comment 10 pflin 2008-06-25 03:23:21 UTC
Some comments need to add for the test document strcon.xls

The conversion types including vbWide and vbNarrow are only applied to East Asia
locales.

The conversion types including vbKatakana and vbHiragana are only applied to Japan.

For there is not default code page in Linux system, the conversion types
including vbUnicode and vbFromUnicode are only applied to Windows system.
 
Comment 11 ooo 2009-03-10 13:57:33 UTC
Assuming that this is about
http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.strings.strconv.aspx
the implementation (and probably also the testcase) of VbStrConv.Wide and
VbStrConv.Narrow is completely wrong. These are not about conversion to/from
Unicode or number of bytes per character (double-byte/single-byte) used, but
full-width versus half-width characters instead. This is not a text encoding
conversion but also a transliteration, use HALFWIDTH_FULLWIDTH and
FULLWIDTH_HALFWIDTH.

It is also questionable why conversion Hiragana <-> Katakana should fail
according to the test case result. Either there are Hiragana/Katakana characters
 in the string to be converted, or there are not.
Comment 12 noel.power 2009-03-10 15:48:20 UTC
->pflin (I have no clue about this, probably worth talking to erAck directly
about this, he knows more than a bit about i18n )
Comment 13 pflin 2009-03-11 04:30:08 UTC
pflin -> er, 

as you see in the attached patch, I really use the a transliteration
HALFWIDTH_FULLWIDTH and FULLWIDTH_HALFWIDTH to implement VbStrConv.Wide and
VbStrConv. 

and as the aboved comments, 
"
The conversion types including vbWide and vbNarrow are only applied to East Asia
locales.

The conversion types including vbKatakana and vbHiragana are only applied to Japan.
"

I think the test case is inaccurate. It needs to improve.
Comment 14 ooo 2009-03-11 10:19:55 UTC
@pflin: sorry, I was confused by that MS documentation page. It does not mention
any Unicode or FromUnicode conversion and given that the "enumeration" doesn't
seem to be an enumeration but bit mask constants instead, I was distracted and
mislead and started counting cases for bits and overlooked the vbWide and
vbNarrow comments and types and was lead to the Unicode conversions being
wide/narrow instead ... sorry for fuzz. So, vbUnicode and vbFromUnicode really
do exist? Please see the thread with subject "Conversion of LocaleID into
codepage" on the dev@l10n mailing list, which actually made me investigating
this. In case you're not subscribed, it starts at
http://l10n.openoffice.org/servlets/ReadMsg?list=dev&msgNo=10660 in the archive.