convertToSloveneChars. Bug?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
J G
Reply | Threaded
Open this post in threaded view
|

convertToSloveneChars. Bug?

J G
Hi,
Programming in Chinese. VWNC7.5+AIDA5.6.
When I:

    self pageFrameWith: e title: self observee class

AIDA complains. The class print string can't convertToSloveneChars.
I searched. About 7 sends of  convertToSloveneChars. Bug?

Best Regards,

Jim G
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: convertToSloveneChars. Bug?

Janko Mivšek
Ni hao Jim,

Jim Guo wrote:

> Programming in Chinese. VWNC7.5+AIDA5.6.
> When I:
>
>     self pageFrameWith: e title: self observee class
>
> AIDA complains. The class print string can't convertToSloveneChars.
> I searched. About 7 sends of  convertToSloveneChars. Bug?

Method #convertToSloveneChars is implemented as extension of String (see
Aida-Extensions) and therefore it must work. See if the method is there
and that it works.

To explain that method a bit: because Aida originally and still runs
Slovenian sites, there are some convenient methods for support of my
language and all Aida supported Smalltalk dialects. As you know there is
still not a dialect which fully supports Unicode from keyboard and on
the screen, Slovenian included, so I just made my own support for that.

For my language it is simple, we have only 3 non-ASCII letters: č š and
ž. I put text elsewhere in code simply as c^ s^ z^, then above mentioned
method convert this in to a real Unicode string.

I propose that this and similar methods stay in Aida, until Smalltalks
will finally support Unicode. If you agree of course!

Best regards
JAnko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
J G
Reply | Threaded
Open this post in threaded view
|

Re: convertToSloveneChars. Bug?

J G
Hi, Janko,

2008/2/18, Janko Mivšek <[hidden email]>:
Ni hao Jim,


Method #convertToSloveneChars is implemented as extension of String (see
Aida-Extensions) and therefore it must work. See if the method is there
and that it works.

....
For my language it is simple, we have only 3 non-ASCII letters: č š and
ž. I put text elsewhere in code simply as c^ s^ z^, then above mentioned
method convert this in to a real Unicode string.

[....]

Thanks. I see.
Chinese Chars would use two bytes,and when they are mixed with single byte letters or something, then in an eye of ASCII, some funny chars occur. VW class printString use to have a point separating the namespace part and class name part. This point, makes the mess. So codes see a $^ char which is not. And the miss read string causes a convertToSloveneChars but, of course, fails.
Haven't found other cases of the same trouble. I'm just starting. I don't know much about Encoding. Too complicated for me. But I do loaded VW Unicode supporting packages.
By the way, a url in Chinese cause exception, a viewChineseChars or an actionChineseChars doesn't work.
However, AIDA/Web is just wonderful and unbelievable.

P.S.
Janko, you might want to mention in the tutorial, that, to setup a new site accessible from Internet, before doing:
(AIDASite named: 'aNewSite')
                host: 'some.domain'
                    ip: '*'
                    port: 80
one should make sure that there is not another site already exists using ip '*' . If there is, an exception will occur. I removed in inspector the demo site when debugging but I don't know what to do if there are multi-sites on one machine.


Best Regards,

Jim G
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: convertToSloveneChars. Bug?

Janko Mivšek
Hi Jim,

Please try this patch, maybe it will help:

String>>convertToSloveneChars
    "convert csz string with ^ as 'sumnik' to proper unicode string.
    Only pure ASCII strings are converted!"
    "'Mivs^ek' convertToSloveneChars"
    | in out ch |
    self class == ByteString ifFalse: [^self].
    in := self readStream. out := WriteStream on: String new.
    [in atEnd] whileFalse:
     ...

As you can see only pure ASCII strings are trying to be converted, so
that Chinese strings won't be counted, because are TwoByteStrings already.

 > However, AIDA/Web is just wonderful and unbelievable.

Well, who doesn't like to hear such a praise :) I'm specially proud that
  Aida works for a whole world already, without much problems. And those
problems are easy solvable. For instance, just recently we
added/finished international Url support to Aida, see

AIDA URL resolution patch by Masashi
http://www.nabble.com/AIDA-URL-resolution-patch-td14798115.html#a14800982


Janko


Jim Guo wrote:

> Hi, Janko,
>
> 2008/2/18, Janko Mivšek <[hidden email]
> <mailto:[hidden email]>>:
>
>     Ni hao Jim,
>
>
>     Method #convertToSloveneChars is implemented as extension of String (see
>     Aida-Extensions) and therefore it must work. See if the method is there
>     and that it works.
>
>     ....
>     For my language it is simple, we have only 3 non-ASCII letters: č š and
>     ž. I put text elsewhere in code simply as c^ s^ z^, then above mentioned
>     method convert this in to a real Unicode string.
>
>     [....]
>
>
> Thanks. I see.
> Chinese Chars would use two bytes,and when they are mixed with single
> byte letters or something, then in an eye of ASCII, some funny chars
> occur. VW class printString use to have a point separating the namespace
> part and class name part. This point, makes the mess. So codes see a $^
> char which is not. And the miss read string causes a
> convertToSloveneChars but, of course, fails.
> Haven't found other cases of the same trouble. I'm just starting. I
> don't know much about Encoding. Too complicated for me. But I do loaded
> VW Unicode supporting packages.
> By the way, a url in Chinese cause exception, a viewChineseChars or an
> actionChineseChars doesn't work.
> However, AIDA/Web is just wonderful and unbelievable.
>
> P.S.
> Janko, you might want to mention in the tutorial, that, to setup a new
> site accessible from Internet, before doing:
> (AIDASite named: 'aNewSite')
>                 host: 'some.domain'
>                     ip: '*'
>                     port: 80
> one should make sure that there is not another site already exists using
> ip '*' . If there is, an exception will occur. I removed in inspector
> the demo site when debugging but I don't know what to do if there are
> multi-sites on one machine.
>
>
> Best Regards,
>
> Jim G
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: convertToSloveneChars. Bug?

Janko Mivšek
In reply to this post by J G


Jim Guo wrote:

> P.S.
> Janko, you might want to mention in the tutorial, that, to setup a new
> site accessible from Internet, before doing:
> (AIDASite named: 'aNewSite')
>                 host: 'some.domain'
>                     ip: '*'
>                     port: 80
> one should make sure that there is not another site already exists using
> ip '*' . If there is, an exception will occur. I removed in inspector
> the demo site when debugging but I don't know what to do if there are
> multi-sites on one machine.

Yes, some better explanation of this is needed on Swazoo website. I
already have this in mind for a while, but time is a limited resource .. :)

JAnko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
J G
Reply | Threaded
Open this post in threaded view
|

Re: convertToSloveneChars. Bug?

J G
In reply to this post by Janko Mivšek
Hi, Janko,
Thanks and the patch works. It's very late into night here, now, so you see learning AIDA/Web is full of fun.

Regards,

Jim


2008/2/19, Janko Mivšek <[hidden email]>:
Hi Jim,

Please try this patch, maybe it will help:

String>>convertToSloveneChars
    "convert csz string with ^ as 'sumnik' to proper unicode string.
    Only pure ASCII strings are converted!"
    "'Mivs^ek' convertToSloveneChars"
    | in out ch |
    self class == ByteString ifFalse: [^self].
    in := self readStream. out := WriteStream on: String new.
    [in atEnd] whileFalse:
     ...

As you can see only pure ASCII strings are trying to be converted, so
that Chinese strings won't be counted, because are TwoByteStrings already.

> However, AIDA/Web is just wonderful and unbelievable.

Well, who doesn't like to hear such a praise :) I'm specially proud that
  Aida works for a whole world already, without much problems. And those
problems are easy solvable. For instance, just recently we
added/finished international Url support to Aida, see

AIDA URL resolution patch by Masashi
http://www.nabble.com/AIDA-URL-resolution-patch-td14798115.html#a14800982


Janko


Jim Guo wrote:
> Hi, Janko,
>
> 2008/2/18, Janko Mivšek <[hidden email]
> <mailto:[hidden email]>>:
>
>     Ni hao Jim,
>
>
>     Method #convertToSloveneChars is implemented as extension of String (see
>     Aida-Extensions) and therefore it must work. See if the method is there
>     and that it works.
>
>     ....
>     For my language it is simple, we have only 3 non-ASCII letters: č š and
>     ž. I put text elsewhere in code simply as c^ s^ z^, then above mentioned
>     method convert this in to a real Unicode string.
>
>     [....]
>
>
> Thanks. I see.
> Chinese Chars would use two bytes,and when they are mixed with single
> byte letters or something, then in an eye of ASCII, some funny chars
> occur. VW class printString use to have a point separating the namespace
> part and class name part. This point, makes the mess. So codes see a $^
> char which is not. And the miss read string causes a
> convertToSloveneChars but, of course, fails.
> Haven't found other cases of the same trouble. I'm just starting. I
> don't know much about Encoding. Too complicated for me. But I do loaded
> VW Unicode supporting packages.
> By the way, a url in Chinese cause exception, a viewChineseChars or an
> actionChineseChars doesn't work.
> However, AIDA/Web is just wonderful and unbelievable.
>
> P.S.
> Janko, you might want to mention in the tutorial, that, to setup a new
> site accessible from Internet, before doing:
> (AIDASite named: 'aNewSite')
>                 host: 'some.domain'
>                     ip: '*'
>                     port: 80
> one should make sure that there is not another site already exists using
> ip '*' . If there is, an exception will occur. I removed in inspector
> the demo site when debugging but I don't know what to do if there are
> multi-sites on one machine.
>
>
> Best Regards,
>
> Jim G
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida



--
Best Regards,

Jim G
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida