How to put unicode text into a field?

4 messages Options
Embed this post
Permalink
Reinhold Venzl-Schubert-2

How to put unicode text into a field?

Reply Threaded More More options
Print post
Permalink
Hi!

Learning polish I want to use unicode text in my stack.

I have a lot of cds with polish vocabularies and now I want to list  
them in a table with this code:

repeat with i = 1 to num of marked cds
   if fld "VocTable" of stack "VocListing" is empty then
     put fld "German" & TAB into fld "VocTable" of stack "VocListing"
   else
     put fld "German" & TAB after fld "VocTable" of stack "VocListing"
   end if
   put fld "Polish" & CR after fld "VocTable" of stack "VocListing"
end repeat

Although in my fields the polish text is well readable in the table  
the special polish letters are transformed to unreadable special  
charakters.

I studied the stack "Unicode in Revolution: Taming the Beast" by Devin  
Asay
but I only found the code:

 > set the unicodeText of fld "VocTable" to the unicodeText of of fld  
"Polish" <

... but the content of my table-field is compound of the contents of  
two or two hundred fields.

Do anybody knows a solution?

Thanks
Reinhold
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Mark Schonewille-3

Re: How to put unicode text into a field?

Reply Threaded More More options
Print post
Permalink
Hi Reinhold,

As an example, your line

put fld "Polish" & CR after fld "VocTable" of stack "VocListing"

should be

set the unicodeText of fld "VocTable" of stack "VocListing" to \
the unicodeText of fld "Polish" & uniencode(cr)

If your software runs on Intel processors only, you might also use cr  
& NULL

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer

Download Strõm Flow Chart Software
http://flowproject.economy-x-talk.com

Op 5 nov 2009, om 18:37 heeft Reinhold Venzl-Schubert het volgende  
geschreven:

> Hi!
>
> Learning polish I want to use unicode text in my stack.
>
> I have a lot of cds with polish vocabularies and now I want to list  
> them in a table with this code:
>
> repeat with i = 1 to num of marked cds
>  if fld "VocTable" of stack "VocListing" is empty then
>    put fld "German" & TAB into fld "VocTable" of stack "VocListing"
>  else
>    put fld "German" & TAB after fld "VocTable" of stack "VocListing"
>  end if
>  put fld "Polish" & CR after fld "VocTable" of stack "VocListing"
> end repeat
>
> Although in my fields the polish text is well readable in the table  
> the special polish letters are transformed to unreadable special  
> charakters.
>
> I studied the stack "Unicode in Revolution: Taming the Beast" by  
> Devin Asay
> but I only found the code:
>
> > set the unicodeText of fld "VocTable" to the unicodeText of of fld  
> "Polish" <
>
> ... but the content of my table-field is compound of the contents of  
> two or two hundred fields.
>
> Do anybody knows a solution?
>
> Thanks
> Reinhold


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Devin Asay

Re: How to put unicode text into a field?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Reinhold Venzl-Schubert-2

On Nov 5, 2009, at 10:37 AM, Reinhold Venzl-Schubert wrote:

> Hi!
>
> Learning polish I want to use unicode text in my stack.
>
> I have a lot of cds with polish vocabularies and now I want to list
> them in a table with this code:
>
> repeat with i = 1 to num of marked cds
>   if fld "VocTable" of stack "VocListing" is empty then
>     put fld "German" & TAB into fld "VocTable" of stack "VocListing"
>   else
>     put fld "German" & TAB after fld "VocTable" of stack "VocListing"
>   end if
>   put fld "Polish" & CR after fld "VocTable" of stack "VocListing"
> end repeat
>
> Although in my fields the polish text is well readable in the table
> the special polish letters are transformed to unreadable special
> charakters.
>
> I studied the stack "Unicode in Revolution: Taming the Beast" by Devin
> Asay
> but I only found the code:
>
>> set the unicodeText of fld "VocTable" to the unicodeText of of fld
> "Polish" <
>
> ... but the content of my table-field is compound of the contents of
> two or two hundred fields.
>
> Do anybody knows a solution?
>

Hello Reinhold,

Since my stack didn't help you much with this problem I'll suggest  
another approach. :-)

One of the difficulties in using unicode in Rev comes when mixing  
ASCII and Unicode text. I can think of a couple of approaches you  
could try (not tested):

1. Use UTF-8 as a transitional encoding. So, using your example:

repeat with i = 1 to the number of marked cds
   put unidecode(fld "German","utf8") into tGmn
   put unidecode(fld "Polish","utf8") into tPol
   if fld "vocTable" of stack "vocListening" is empty then
     put tGmn & tab & tPol into tCombined
   else
     put unidecode(fld "voctable","utf8") & tab & tCombined into  
tCombined
   end if
   set the unicodeText of fld "vocTable" to uniencode(tCombined,"utf8")
end repeat

2. Use htmlText (not sure how or if this would work with table fields):
repeat with i = 1 to the number of marked cds
   put the htmlText of fld "German" into tGmn
   put the htmlText of fld "Polish" into tPol
   if fld "vocTable" of stack "vocListening" is empty then
     put tGmn & tab & tPol into tCombined
   else
     put the htmlText of fld "voctable" & tab & tCombined into tCombined
   end if
   set the htmlText of fld "vocTable" to tCombined
end repeat

Hope this helps.

Regards,

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reinhold Venzl-Schubert-2

Re: How to put unicode text into a field?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Reinhold Venzl-Schubert-2
Hi Devin!

thanks for your help. I tried it with unicode, also utf8, but I failed.
I guess the problem is, that polish is not a complete other font.
There are only some charakters that are different and not part of ANSI.
Therefore a word contains unicode-charakters and ANSI-charakters.

But I was successful in using HTML. I could not use it in a tablefield  
(no TAB possible),
but with some sleight of hand I build my table-field with several  
simple fields.

:-)
Reinhold


> Hello Reinhold,
>
> Since my stack didn't help you much with this problem I'll suggest
> another approach. :-)
>
> One of the difficulties in using unicode in Rev comes when mixing
> ASCII and Unicode text. I can think of a couple of approaches you
> could try (not tested):
>
> 1. Use UTF-8 as a transitional encoding. So, using your example:
>
> repeat with i = 1 to the number of marked cds
>   put unidecode(fld "German","utf8") into tGmn
>   put unidecode(fld "Polish","utf8") into tPol
>   if fld "vocTable" of stack "vocListening" is empty then
>     put tGmn & tab & tPol into tCombined
>   else
>     put unidecode(fld "voctable","utf8") & tab & tCombined into
> tCombined
>   end if
>   set the unicodeText of fld "vocTable" to uniencode(tCombined,"utf8")
> end repeat
>
> 2. Use htmlText (not sure how or if this would work with table  
> fields):
> repeat with i = 1 to the number of marked cds
>   put the htmlText of fld "German" into tGmn
>   put the htmlText of fld "Polish" into tPol
>   if fld "vocTable" of stack "vocListening" is empty then
>     put tGmn & tab & tPol into tCombined
>   else
>     put the htmlText of fld "voctable" & tab & tCombined into  
> tCombined
>   end if
>   set the htmlText of fld "vocTable" to tCombined
> end repeat
>
> Hope this helps.
>
> Regards,
>
> Devin

>> Hi!
>>
>> Learning polish I want to use unicode text in my stack.
>>
>> I have a lot of cds with polish vocabularies and now I want to list
>> them in a table with this code:
>>
>> repeat with i = 1 to num of marked cds
>>  if fld "VocTable" of stack "VocListing" is empty then
>>    put fld "German" & TAB into fld "VocTable" of stack "VocListing"
>>  else
>>    put fld "German" & TAB after fld "VocTable" of stack "VocListing"
>>  end if
>>  put fld "Polish" & CR after fld "VocTable" of stack "VocListing"
>> end repeat
>>
>> Although in my fields the polish text is well readable in the table
>> the special polish letters are transformed to unreadable special
>> charakters.
>>
>> I studied the stack "Unicode in Revolution: Taming the Beast" by  
>> Devin
>> Asay
>> but I only found the code:
>>
>>> set the unicodeText of fld "VocTable" to the unicodeText of of fld
>> "Polish" <
>>
>> ... but the content of my table-field is compound of the contents of
>> two or two hundred fields.
>>
>> Do anybody knows a solution?
>>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution