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 08:52:37 -0600
References: <BC225E01 dot 94137%support at groundlevel dot net>
At 1:08 AM -0800 1/8/04, Jeffrey Ellis wrote:

We have found that in Shift-JIS (which is what I've been told is the system
RB 4.5 uses for Japanese when compiling), the "\" character is displayed as
"¥" instead. We know that there are other "\" 's which can be used ( a bunch
of them in fact), but we  haven't got the vaguest idea how to do a find and
replace of one shift-jis (or for that matter, even one Unicode character)
with another.

I would like to use Unicode 2572 to replace the Unicode 005c character.

It seems to me there are a lot of assumptions here that don't fit together. If you were using Unicode, then this problem probably wouldn't occur. If you're not using Unicode, then of course you can't replace one Unicode character with another.

If you see a Yen symbol where you expect a backslash, it's probably because the your text is indeed in Shift-JIS, and the backslash and Yen symbol occupy the same code point, displayed differently depending on which font you use. If that is the case, then there's little you can do about it except switch to a different encoding, or switch to a different font.

Probably the easiest solution is to upgrade to 5.x, where strings are compiled as UTF-8, and (at least on OS X) this problem will not occur.

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>