Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 15th, 2008, 05:13 PM
Authorized User
 
Join Date: Jul 2007
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Does VB6 support double byte Asian Languages?

Hi,

I have a scenario that I'm hoping to see if anyone has come across this. Basically, we wrote an app in VB6 at work. Everything had been tested in regular English Win XP and Vista and confirmed that it's working fine. This app was then installed in Korea, with the Korean version of Windows OS. It was just reported to us that it's not working at all.

Well to make it short, in our code, we have to communicate to a proprietary USB device. The USB communication chip that we purchased retrieves the input buffer from the USB port as a type string. We then depend on the ASC() and Chr() functions in VB 6 a lot to do the parsing of the input buffer. Well, ASC() and Chr() work fine in single byte languages, but we just confirmed that they do not work for double byte asian languages, in this case Korean.

Has any one here come across this problem in the past? The thing that I can't understand is that for example: a character of ASCII code 128, if you run this through the ASC() function, in single byte language systems, it should give you back the value of 128. However, I have noticed that in a double byte language system, it gave me a really strange value of -23834. How can this happen?

If you have any thoughts on this, I really appreciate your help.

Thank you.

Khoi Nguyen
__________________
Khoi Nguyen
 
Old August 18th, 2008, 12:53 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

The interpretation of numbers sees the most significant byte as the sign. If it is 1, the number is negative. That's how that can happen.

I'm afraid I don't have more to offer on the main question.
 
Old August 19th, 2008, 03:01 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Try using ASCW() and CHRW() instead of ASC() and CHR().

I haven't used them with VB6, but they work correctly with VBScript. The "W" is for "W"ide characters--Unicode.

But this may not work at all, depending on how that USB device works. If it can't handle Unicode you may have to do a *LOT* of work, yourself.

Don't you have documentation from the chip manufacturer??





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error-Object does not support doesn't support this bootsy Classic ASP Basics 1 May 25th, 2008 07:14 PM
VB6, COM, Object doesn't support this property... thenoseknows Classic ASP Professional 1 July 12th, 2007 05:54 PM
Two languages application soc22 Access VBA 2 October 12th, 2006 06:04 PM
Byte alignment or byte padding subodh_chettri C++ Programming 0 June 23rd, 2006 10:35 AM
asian language support in tomcat 5.x ericshai Apache Tomcat 2 October 29th, 2004 07:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.