On Wed, Feb 18, 2009 at 3:28 PM, June Kim <[email protected]> wrote:
> There are two ways, one is simpler but specialized, the other complex
> but generic.
>
>
> n=: <;._2 (0 : 0)
> Función
> Esdrújula
> Corazón
> Sin_acento
> )
>
> Following two solutions use the noun n as defined above:
>
> 1. Simpler but specialized (using the codepage for Spanish 1252)
>
>   n   NB. broken box display
> +--------+----------+--------+----------+
> |Función|Esdrújula|Corazón|Sin_acento|
> +--------+----------+--------+----------+
>   mb=:1252&u...@ucp"1
>   mbi=:utf8@(1252&m2u)"1

u2m and m2u are defined as:

   u2m
4 : 'r=. (>{.rc){.>_4{rc=. ''kernel32 WideCharToMultiByte i i i *w i
*c i i i''&cd x ; 0 ; (, y) ; n ; (, n3#'' '') ; (n3=. 4*n=. #y) ; 0 ;
0'
   m2u
4 : 'r=. (>{.rc){.>_2{rc=. ''kernel32 MultiByteToWideChar i i i *c i
*w i''&cd x ; 0 ; (, y) ; n ; (, n#u:'' '') ; n=. #y'

As you see this is platform specific (windows) -- another disadvantage.

>   hd=:":`([: mbi [: ": mb@":&.>)@.(-.@(-: >) ::1:)
>   hd n   NB. proper box display
> +-------+---------+-------+----------+
> |Función|Esdrújula|Corazón|Sin_acento|
> +-------+---------+-------+----------+
>
>
>
>
> 2. Complex but generic (using font width data)
>
> Using the code at http://www.jsoftware.com/jwiki/JuneKim
>
>   todisplay thbox n  NB. you should change the box character set in
> order to draw it with ascii line characters
> +-------+---------+-------+----------+
> |Función|Esdrújula|Corazón|Sin_acento|
> +-------+---------+-------+----------+
>
>
> On Wed, Feb 18, 2009 at 5:35 AM, Alfonso Salazar <[email protected]> wrote:
>> Friends:
>>
>> ¿J602a discriminate  Spanish?
>> See below Spanish words with an accent.
>> The flaw is in the drawing box
>>
>> +--------------+
>>  | Función |
>> +--------------+
>>  |Esdrújula|
>> +--------------+
>>  | Corazón |
>> +----------    +
>>  |Sin_acento|
>> +--------------+
>>
>> What hapen?
>> Alfonso
>>
>>
>> __________________________________________________
>> Correo Yahoo!
>> Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
>> Regístrate ya - http://correo.yahoo.com.mx/
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to