obligatory

archives

recent

BBEdit + Japanese + Backslash HTF?!?!

Does anyone know how the heck I can input a backslash into BBEdit on this dang-fangled Mac?

I have tried (almost) every font, various encodings, and still can't directly input a \ into BBedit.

Apparently it has to do with Mac OS X using Unicode. In the good old days, the ¥ (yen symbol) and \ where one and the same char, just displayed differently depending on the system you were using, so using ¥ as an escape character was not a problem. Now however, with the wonders of Unicode, \ and ¥ are different characters. Problem is, the Mac keyboard doesn't have a \.

And Alt+¥ doesn't work... at least not in BBEdit. Instead it gives me a "«". This is a major problem. Huge! Before I was only worried that I had to use a text editor with an interface I didn't like as much as the one I was used to... now I can't even use BBEdit, unless I copy and paste all backslashes from some other application. That's not good.

I hear everyone say good things about BBEdit, which means some of you actually use it right? If so you *must* have come across this right? Pleeeeeassse tell me what you found.

UPDATE:
Thanks to Dirk for pointing out that BBEdit Lite 6.1 *is* backslash compatible. And what's more, it's free. It's missing some of the functionality I really enjoyed in UltraEdit, but it seems to be the best text editor I have seen for Mac OSX so far.

Just for the record, he also downloaded the 7.04 Demo version and proved me correct that it is in fact impossible to input a backslash on the new and improved version.

Comments about BBEdit + Japanese + Backslash HTF?!?!

Well, the english mac keyboard does have a \ key. It's located at the far right just above the return key. I dunno how Japanese programmers (or end users) manage without it...

Posted by: John at November 11, 2003 07:21 PM

Have you tried using the International Input menu? I've always used it to switch from US English to Japanese input whenever I had to type kana. Perhaps it would map your Japanese keyboard to the US equivalent for you, so you could type in the backslash? In 10.3, it's in System Preferences > International > Input Menu.

Posted by: James at November 11, 2003 07:54 PM

I am pressing the ¥ key in BBEdit lite and a backslash appears. Maybe I am doing something "wrong". What's the problem?

Make sure you set two keyboards (US and Japanese) and choose US to do the backslash.

I find many (ex-)Windows users have problems using the Mac, because many things are too obvious for them. They expect complexity when there isn't any. That frustrates them. You need a de-tox, my friend. ;)

Also check out http://hydra.globalse.org/ for programming.

Dirk

Posted by: Dirk at November 12, 2003 04:26 AM

John,

If I would have known I would have gotten an english version keyboard. As it is I may have to buy one to replace the keyboard on it now? How much is a keyboard for an iBook?

James,
I've tried everything. Changing to an English input menu doesn't help. It just gives me another non-backslash character.

Dirk,
First let me get this out of the way :-)

I find many (ex-)Windows users have problems using the Mac, because many things are too obvious for them. They expect complexity when there isn't any. That frustrates them. You need a de-tox, my friend. ;)

What I am frustrated with now is that everything is way more complex than it should be. With UltraEdit in windows, I simply open the file and type. I never had to specify the encoding before I open the file, never had to swtich keyboards when I switch from English to Japanese... it was so simple. Plug and play.

Make sure you set two keyboards (US and Japanese) and choose US to do the backslash.

That's crazy :-). It's almost as easy to copy paste the backslashed from another app.

Now......

If you can save me I love you.

I have been writing to BBEdit and they say that a Japanese ¥ is the same as \. But it doesn't work that way for me.

For now I have set up an Applescript that simply replaces all Yens with \ . Not ideal, but it allows me to write workable programs. However, this does not help when I use the BBEdit search & replace with Grep. For this I have to copy a backslash from another application and paste it into the search & replace box.

I have tried the following,

1) Create a file as encoding Japanese EUC. Using Osaka font, I was unable to type a backslash. I did not test if the yen mark would be interpreted correctly by Perl, however I did try using the BBEdit Grep function. Since I was unable to type a \, I tried to replace

¥d with X

Nothing happened even though there were several digits in the file. When I replaced the ¥ with a \ I copied from another app, the grep worked fine.

2) Repeat same procedure with Western ISO-2 encoding and an English font (with American input mode). Same results.

3) Attempt to repeat the same with Western ASCII as the encoding. When I tried to save the file however, BBEdit gave me an error saying there was one or more character that could not be represented, and I have to save it as another encoding. Presumably this was because of the ¥ marks.

Can you tell me the exact settings you have for yours when you are able to make Grep work? I.e what is the encoding, what is the font, and what input method are you using? Are you using a Japanese keyboard?

Posted by: kevin at November 12, 2003 04:58 AM

That Dirk, he may be German,but he's useful now and then. If I can get him along to a bloggers meeting some time, you should buy him a glass of Leibfraumilch (sp?)

Posted by: Gary at November 12, 2003 03:40 PM

The keyboard is pretty easy to replace, but from Apple it's _very_ expensive! Perhaps a third party can get you one for less, but probably not because you're on the lastest rev ibook which I believe uses a new design keyboard - thus no used parts available (yet).

Posted by: John at November 12, 2003 07:09 PM

Try pressing option-yen key. Alternatively, in BBEdit's prefs, in the Text Editing pane, turn off "Enable Unicode Input".

That should do it.

Posted by: Ado at November 12, 2003 10:35 PM


Ado: that ain't working, just tried. If you look at the BBEdit support FAQs it's an acknowledged problem; apparently only on Japanese systems. Maybe more research is required.

John: yeah, Apple keyboards are expensive - maybe because there's an iBook attached to them

Gary: ...

Dirk

Posted by: Dirk at November 13, 2003 06:49 AM

Actually Dirk,

What Adriaan suggested worked for me.
When I am writing in a tect document it still appears as a yen, but it is actually the same hex value as a backslash so the programs understand it.

More importantly, unchecking the "Allow Unicode Input" box allowed me to put a real backslash in the Search and Replace box when using grep.

I have no idea how I could not have seen that after three days of reading the manual and checking/unchecking every option in the preferences, and i *really* have no idea why the BBEdit support people didn't tell me that (although they gave me lots of great hints and tips... very attentive and swift responses).

Posted by: kevin at November 13, 2003 07:07 AM

Still not perfect. Try typing ¥ into your doc and grep for \\ ... not found. Works in lite. (option-¥ results only in a little

Let's face it, it's broken. You're playing with fire trying to debug with such an uncertainty.

Dirk

Posted by: Dirk at November 13, 2003 07:22 AM

I have the same issue with my non-Japanese keyboard so I don't think a different keyboard would be a solution. I've copy-pasted backslashes when and where I need them and kept Japanese text out of my code files entirely. I put Japanese text into variables in a separate file and just call the variables in my code. This has the side benefit of being able to use plain Monaco for coding instead of Osaka-mono. But that's not a usable workaround for everybody.

Posted by: Kirk Samuelson at November 13, 2003 07:29 PM

As far as I know it's to do with a mapping problem regarding keyboard and font input. Perhaps Japanese programmers had some serious blindspot in the early days of nihongo+computer development.

I tend to put all my Japanese into a database or into a separate file - makes the site bilingual anyway, but occasionally I have the same problem, and to be frank I haven't found a very good solution. Especially as all my sites are in Unicode. I sometimes have the same problem with the tilde too - and all this is seriously compounded by me using Dvorak!

Although you could try using jedit
http://www.artman21.net/
which can deal with it.
It's not a patch on BBEdit though.

Further, I have problems with BBEdit 7 refusing to open Japanese files correctly when they were created by another program. Then when you convert them to Osaka, BBEdit gets too clever and mangles the text completely.

Posted by: Gary Ross at January 8, 2004 07:05 PM

I too think BBedit 7 has it's head screwed on wrong, but there is a work around:

1] under the "#!" (Unix script) menu look for "Unix Filters"

i] select an existing filter script and option click it - this will open the script for editing.

ii] leave the shebang line (#! /usr/bin/perl-w) but delete everything else.

iii] write (no double quotes) "print '\\';"

iv] save it as something else (I called mine backslash.pl) - don't change the location shown by the save dialog so the file will be saved in the Unix filter folder (important for this hack to work).


2] Under the "Window" menu

i] look for "palettes" -> "Unix Filters" and select it. You should now see a list of filters including the one you just made.

ii] Select your script in the palette and click on the "Set Key" button at the top right corner of the palette, this opens a dialog asking for a key setting.

iii] Press some keys - I wanted to set OPTION ¥ as the key binding, to keep things consistent with how I normally get a backslash but BBedit won't accept the option key in this dialog, so I settled for APPLE + ¥. (this is the default binding for hard formatting line endings in text, so you'll have to confirm the change if you use this combo).

That's it. By pressing the key combo you run the filter which acts on the front window, which prints a backslash at the current cursor position.

Posted by: Robin McFarlane at January 25, 2004 10:52 PM

Hi,

My company (touch-screen video games) is building its market in Japan and I was given the task to develop a touch-screen keyboard for the players to enter their names during competitions.

Can anyone help me understand how the Japanese keyboard works? How many characters are required?

Thank you in advance

Posted by: Francois at October 12, 2004 05:53 AM


galleries

2003.08.04
2003.08.02
2003.04.21
2003.07.21
2003.07.19
2003.07.13
2003.07.08
2003.07.07
2003.07.05
2003.06.23
2003.06.21
2003.06.08