REWARD: chr() not working for Chinese "Locale"

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: John Cody (newsgroups_at_noospammmax-soft.com)
Date: 10/04/04


Date: Mon, 4 Oct 2004 11:43:26 -0400

Hi,

I have a real stumper of an issue...I am creating a string, character by
character by doing a:

Do
    S = S & CHR(X)
Loop while ....

The value of X will randomly vary from 0 to 255 (FF). And, with my
Smartphone's "Locale" setting to "English", the string is built of the
proper individual characters representing the specified values for X.

But, if a user's Smartphone has their "Locale" set to "Chinese", the CHR()
function doesn't appear to create the proper characters for X values above
127 (highest ANSI code). For example, if the sequential values of X are 237,
207, 45.....if I then loop through the string and read the ASC() of each
individual character, I will get 31, 31, 45 when the "Locale" is Chinese. If
I instead use CHRB(x), then the resulting ASC() values will be 169,169, 45
for a "Chinese" locale (NOTE: using the alternate chrb() method still works
fine on "English" locales)

I'm thinking that this is related to some Unicode issue, and that the
characters representing codes 128-255 are invalid for a Chinese "locale".
But, this is just a guess.

This is a real-pain of an issue to fix because I can not reproduce the
error - I have to keep "bugging" a [very helpful] Hong Kong user to test
different trace/debug versions on their "Chinese" local phone to see if it
fixes the issue, but this is not fair to them...

So, I am offering a reward of a FREE copy for one of my products:

http://www.omnisoft.com/products.asp

For anyone who first posts the solution to this issue...

Thanks a bunch!

-John Cody



Relevant Pages

  • Re: Writing Japanese or Chinese strings in a text file
    ... what locale are you running in? ... So they are right in the excel file. ... > original characters). ... web page (exactly I put with VB the string from a textarea in a chinese ...
    (microsoft.public.vb.general.discussion)
  • Re: How to check variables for uniqueness ?
    ... FI in English typography), so the correct uppercase version of those ... characters is the sequence SS. ... So you at least agree with me that it should be consistent with toUpperCase -- all strings should have a single canonical toUpperCase, a single canonical toLowerCase, both should define equivalence classes on the mixed-case input strings, these should be the SAME equivalence class, and equalsIgnoreCase should implement and embody the corresponding equivalence relation. ... The version that doesn't shouldn't surprise English speakers; the version that does shouldn't surprise anyone familiar with its locale-specific behavior for the locale actually used. ...
    (comp.lang.java.programmer)
  • Character encodings
    ... I'm looking for an easy way to remove french characters and replace them ... with their english equivalent. ... French String: Jôêl ... English String: J??l ...
    (comp.lang.java.help)
  • Re: Reg multilanguage support by gnuplot
    ... The "locale" setting is need in order to interpret 1-byte character ... It is not needed if you are using UTF-8. ... type the characters directly into your command string. ... set label 1 at screen 0.2, ...
    (comp.graphics.apps.gnuplot)
  • Re: [slrn] newbie stuck some what
    ... But you'll need to adjust your locale settings from ISO-Latin to ... That can't be done based on the rightmost five characters, ... But I'm not a stranger to string ... I'm a stranger to all programming (apart from my BASIC experiments ...
    (news.software.readers)