[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Draft] Writing i18n apps with glibc 2.2



On Wed, Oct 18, 2000 at 08:40:20AM +0800, thhsieh@linux.org.tw wrote:
> : Sometimes I need to work with native encodings and can't convert them
> : to widechar though ... like Firebird -_-; although it'd be pretty nice
> : if everything in a BBS is in Unicode :p
> 
> This is the point: Do you want your BBS system go to internationalization
> or just a local program like before?

i18n is just one of the few problems with the current stuff that makes
me want to totally rewrite it eventually.

> If you want to go to i18n, then in your program you should not make any
> assumption on how to handle the characters.  All of these details should
> left for libc to take care, even though you don't want to use Unicode.

Agree.

> I mean, you can convert them using mbsrtowcs() to verify that they are
> valid characters, and handle the wide characters internally. When you
> want to output the characters in any form (print it out, or save to file,
> or pipe or translate to other program .... etc), then transform them
> back to multi-byte characters via wcsrtombs().

At first I thought that it would be inefficient to do things this way.
On second thought however, it doesn't seem so inefficient, especially
with the amount of string handling that needs to be done inside a BBS.
(There's so much string handling that I just want to rewrite the whole
thing in Perl .. hehe :p)

> In this way you don't need to make any assumption of the encoding you
> are handling. However, doing this way you really have to modify your
> BBS program very much :-)) So, is it worth to do that? Is the BBS program
> suitable to become a I18N program? This depends on your policy. :-))

Well, eventually it needs a rewrite anyway; Firebird is now a pile of
very old code, and people keep adding stuff to it everywhere that it's
now basically unmaintainable.  (The Firebird 3.0 team might disagree 
with me though ...)

What I really want to do is to separate it into client/server, using
MySQL/PostgreSQL as the backend, use CORBA for network transparency
(ORBit looks nice...), and using widechar all the way.  When I get the
time ...

This is getting really offtopic now. :p

-- 
  Roger So                                            telnet://e-fever.org
  spacehunt at e-fever dot org                          SysOp, e-Fever BBS
  GnuPG  1024D/98FAA0AD  F2C3 4136 8FB1 7502 0C0C 01B1 0E59 37AC 98FA A0AD



Reply to: