realbasic-nug
[Top] [All Lists]

Re: How to find and replace Shift-JIS characters

To: "REALbasic Network Users Group" <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: How to find and replace Shift-JIS characters
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Thu, 8 Jan 2004 20:45:25 -0600
References: <BC23398D dot 968CC%support at groundlevel dot net>
At 4:45 PM -0800 1/8/04, Jeffrey Ellis wrote:

I'm sorry, but I'm not sure I understand. The Unicode for the "¥" character
is 00A5, but in Shift-JIS it becomes 005C, which is normally the Unicode for
the "\" character. Whereas the "\" is normally 005C but in Shift-JIS it is
0080. Why can't we just find and replace one for the other?

I still don't see what Unicode has to do with it, given that you're working in 4.5, which does not compile your strings as Unicode.

However, let's try this: you believe that Shift-JIS character &h5C in your strings (the Yen symbol) should be replaced with &h80 (the backslash). That can be done, in RB 4.5, this way:

  s = ReplaceAll( s, Chr(&h5C), Chr(&h80) )

Perhaps this is what you're looking for.

HTH,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout           REAL Software, Inc.                |
|    joe at realsoftware dot com       http://www.realsoftware.com        |
`------------------------------------------------------------------'

- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>