Re: Unicode Question

2008-08-31 Thread Jim Sims


On Aug 30, 2008, at 8:02 PM, David Bovill wrote:


Still having a few problems:

Using this function:

setprop view_Utf8 someUtf8
   put the text_Field of me into textField
   put uniencode(someUtf8, UTF8) into someU16
   set the unicodetext of textField to someU16
end view_Utf8


David,

I wonder if the following is of any help for you:
http://www.mail-archive.com/use-revolution@lists.runrev.com/msg91205.html

It refers to example stacks:

go stack URL http://revolution.byu.edu/unicode/unicodeInRev.rev;
go stack URL http://revolution.byu.edu/unicode/unicodeExamples.rev;

sims

ClipaSearch Pro
http://www.ClipaTools.com

Across Platforms - Code and Culture
http://www.ezpzapps.com/blog/




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Unicode Question

2008-08-30 Thread David Bovill
Still having a few problems:

Using this function:

setprop view_Utf8 someUtf8
put the text_Field of me into textField
put uniencode(someUtf8, UTF8) into someU16
set the unicodetext of textField to someU16
end view_Utf8


and getting UTF8 from the XML file (an assumption), I get results lik:

gustavb\u00f6hm

which should be a nice german name :)
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Unicode Question

2007-02-04 Thread Mark Smith
Hi, all. I'm finally updating my id3 tag library (it will write as  
well as read), and I want to handle unicode issues correctly.


My question is : when using any library that is going to give you  
back some text as the result of a function, how is it best to  
indicate whether it is unicode or not, so that you can then just put  
it into fld x if it's not unicode, or set the unicodeText of fld x  
if it is.


Bearing in mind that the text might be anything, might have commas,  
returns or other delimiters, would it be best to return an array:


tText[text] - the text, tText[encoding] - iso | utf16 | utf8

or is there a better way?

Any thoughts gratefully recieved.

best,

Mark
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Unicode Question

2007-02-04 Thread David Bovill

I hope I got your question right - it is more abot an interface style to a
library than auto-detecting whether which format the data is in?

If so - arrays are a good bet, but in my opinion the most user friendly
approach is to create a model which deals with the functions and commands
for getting and setting the ID3 data from the file, and then a set of
simpler getprop and setprop interfaces that users would use with a Rev based
control. In your case it would look something like:

-- Model
-
function id3_GetArray someFile
 ...
end id3_GetArray someFile

on id3_SetArray someFile, id3Array
 ...
end id3_SetArray someFile


-- Interface
-
getprop id3_UnicodeText
 put the filename of the target into someFile
 put id3_GetArray(someFile) into id3Array
 return id3Array [unicode]
end id3_UnicodeText

And so forth for the various elements of the model you want to expose in a
friendly way to the user. They can then just set the filename of the player
to a mp3 file and use:

 put the id3_UnicodeText of player 1

If there are too many interfaces you can use the array type sytax:

 put the id3_Data [unicode] of player 1

With and getprop handler like:

getprop id3_Data [someKey]
 put the filename of the target into someFile
 put id3_GetArray(someFile) into id3Array
 return id3Array [someKey]
end id3_Data
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Unicode Question

2007-02-04 Thread Mark Smith

David, thanks for the reply - it's actually both questions.
I like the style of interface using set/getprops, and will probably  
do exactly what you suggest.


However, the unicode problem is that in an ID3 tag, text information  
(that the library will extract from the tag) may be encoded as  
unicode or not, and it isn't necessarily consistent within a tag ie.  
some strings are, some aren't. So I need to figure out how best to  
let the user of the library know what kind of string is being delivered.


Best,

Mark


On 4 Feb 2007, at 15:37, David Bovill wrote:

I hope I got your question right - it is more abot an interface  
style to a

library than auto-detecting whether which format the data is in?

If so - arrays are a good bet, but in my opinion the most user  
friendly
approach is to create a model which deals with the functions and  
commands

for getting and setting the ID3 data from the file, and then a set of
simpler getprop and setprop interfaces that users would use with a  
Rev based

control. In your case it would look something like:

-- Model
-
function id3_GetArray someFile
 ...
end id3_GetArray someFile

on id3_SetArray someFile, id3Array
 ...
end id3_SetArray someFile


-- Interface
-
getprop id3_UnicodeText
 put the filename of the target into someFile
 put id3_GetArray(someFile) into id3Array
 return id3Array [unicode]
end id3_UnicodeText

And so forth for the various elements of the model you want to  
expose in a
friendly way to the user. They can then just set the filename of  
the player

to a mp3 file and use:

 put the id3_UnicodeText of player 1

If there are too many interfaces you can use the array type sytax:

 put the id3_Data [unicode] of player 1

With and getprop handler like:

getprop id3_Data [someKey]
 put the filename of the target into someFile
 put id3_GetArray(someFile) into id3Array
 return id3Array [someKey]
end id3_Data
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Unicode Question

2007-02-04 Thread David Bovill

I am not really sure - can you put it into a field and if it differs from
the original text value assume it is unicode, or maybe regEx looking for
some chars outside of the ascii range?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Unicode Question

2007-02-04 Thread Mark Smith
That's the point - I don't want the user to have to guess. The  
library 'knows', because the encoding information is in the id3 tag  
it's just read, what I'm wondering about is simplest wasy to let the  
user of the library know.


So if the 'client' app asks the library for the title of a file, the  
library needs to let the client know that it's Abbey Road, as  
unicode or plain text, depending on how the original tag was encoded,  
so the client can display it properly.


I guess what I'm asking is what most developers would prefer to be  
returned when using the library.


Best,

Mark


On 4 Feb 2007, at 17:03, David Bovill wrote:

I am not really sure - can you put it into a field and if it  
differs from
the original text value assume it is unicode, or maybe regEx  
looking for

some chars outside of the ascii range?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Unicode Question

2007-02-04 Thread Mark Schonewille

Hi Mark,

May I suggest that you translate all strings into and deliver all  
strings as ut8? This would avoid any confusion on the user's side.


Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Get your store on-line within minutes with Salery Web Store software.  
Download at http://www.salery.biz


Op 4-feb-2007, om 18:22 heeft Mark Smith het volgende geschreven:

That's the point - I don't want the user to have to guess. The  
library 'knows', because the encoding information is in the id3 tag  
it's just read, what I'm wondering about is simplest wasy to let  
the user of the library know.


So if the 'client' app asks the library for the title of a file,  
the library needs to let the client know that it's Abbey Road, as  
unicode or plain text, depending on how the original tag was  
encoded, so the client can display it properly.


I guess what I'm asking is what most developers would prefer to be  
returned when using the library.


Best,

Mark


On 4 Feb 2007, at 17:03, David Bovill wrote:

I am not really sure - can you put it into a field and if it  
differs from
the original text value assume it is unicode, or maybe regEx  
looking for

some chars outside of the ascii range?



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Unicode Question

2007-02-04 Thread Mark Smith
Mark, this seems like a good idea. Would I be right in thinking that  
to translate a string from UTF16 to UTF8 I would do this:


put unidecode(someUTF16String,UTF8) into tUTF8String ?

Thanks,

Mark

On 4 Feb 2007, at 18:23, Mark Schonewille wrote:


Hi Mark,

May I suggest that you translate all strings into and deliver all  
strings as ut8? This would avoid any confusion on the user's side.


Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Get your store on-line within minutes with Salery Web Store  
software. Download at http://www.salery.biz


Op 4-feb-2007, om 18:22 heeft Mark Smith het volgende geschreven:

That's the point - I don't want the user to have to guess. The  
library 'knows', because the encoding information is in the id3  
tag it's just read, what I'm wondering about is simplest wasy to  
let the user of the library know.


So if the 'client' app asks the library for the title of a file,  
the library needs to let the client know that it's Abbey Road,  
as unicode or plain text, depending on how the original tag was  
encoded, so the client can display it properly.


I guess what I'm asking is what most developers would prefer to be  
returned when using the library.


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Unicode Question

2007-02-04 Thread David Bovill

Well inside Rev - I think that most users would like to use the htmlText.


From my point of view i would like to be able to do the following:


  set the text of fld Title to the id3_Title of player 1
  set the htmltext of fld Title to the id3_Title [htmlText] of player
1  -- (could have id3_HtmlTitle as well)
  set the unicodeText of fld Title to the id3_Title [unicode] of player
1

And query the player like:

  put the id3_TextFormats of player 1 into availableFormats
  put the id3_TitleArray of player 1 into titleArray
  if unicode is among the items of availableFormats then set the
unicodeText of fld 1 to titleArray [unicode]

But in general i don't see why you would need to do anything other than one
of the first three (I'd use the . The library would just give you the format
if it were available and if not give you the text which would work fine. The
library would just need to uniencode the plain text - ie set the unicodetext
of fld 1 to uniencode(Test) works fine.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Unicode question

2005-05-06 Thread Thomas McGrath III
Hello,
I was wondering if once the unicodetext of a fields content has been 
set if that field will then Keep that characteristic always. Or do I 
then always have to use the set the unicodetext of when I am putting 
text into fields? Is this the same for variables as well?

set the unicodetext of field one to the unicodetext of field two
Later if I set the contents of field one to  and then add some 
other text will it still test unicodetext positive. I tried the docs 
for the unicode test but it didn't work for me.

Thanks
Tom

Macintosh PowerBook G-4 OSX 10.3.8, OS 9.2.2, 1.25 GHz, 512MB RAM, Rev 
2.5

Advanced Media Group
Thomas J McGrath III
[EMAIL PROTECTED]
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution