I have been developing a Cherokee-English dictionary for several years, and about a year ago, I decided I needed to store my data in xml format, so it can be converted to a dictionary server-useable format.
The problem is, I have one field in Cherokee syllabary (entered directly into my Revolution field), which needs to be saved in the xml file. I have read everything I can find about Rev and unicode, but I can't get anything to work correctly! I get garbage in my xml file every time.
I just renewed my Rev license after a long lapse, hoping that some progress has been made. I hope I didn't waste my money.
If anyone can help me, I would be grateful!
(Mac osx - Rev 2.7.2)[/i]
Need help with unicode and xml
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
I also had similar issues until I picked up STS XML Library from Sons of Thunder. It is a reasonable priced and works so good.
If posting a link to it's web page is not good some let me know and I will edit the post, and remove it.
http://www.sonsothunder.com/products/xmllib/xmllib.htm
They have much info on the difference of this library and revolutions built in XML lib. I think revolution build in lib is great it does not do every thing that STS XML Lib does.
If someone else has a direct solution with run revs lib to fix your problem I still recommend checking out this helpful solution.
If posting a link to it's web page is not good some let me know and I will edit the post, and remove it.
http://www.sonsothunder.com/products/xmllib/xmllib.htm
They have much info on the difference of this library and revolutions built in XML lib. I think revolution build in lib is great it does not do every thing that STS XML Lib does.
If someone else has a direct solution with run revs lib to fix your problem I still recommend checking out this helpful solution.
Thanks, this will help me with XML, but....
This will help with my xml. The unicode, though, is still my biggest problem.
Why oh why did the developers decide to go with utf16, when the rest of the world uses utf8? I just don't get it!
Why oh why did the developers decide to go with utf16, when the rest of the world uses utf8? I just don't get it!
Dear Tsalagi,
Economy-x-Talk has a lot of experience with unicode and can help you. Maybe, we should find a non-xml solution. Please, write me off-list with a detailed description of the problems at support@economy-x-talk.com
Best regards,
Mark
Economy-x-Talk has a lot of experience with unicode and can help you. Maybe, we should find a non-xml solution. Please, write me off-list with a detailed description of the problems at support@economy-x-talk.com
Best regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
**Dear Tsalagi,
**I use this code to generate my XML file in unicode
**GeneratedLfile is your ".xml" file
**field "PreXML" would be your "field in Cherokee syllabary" which should be written in XML of course
on mouseUp
---------------UTF8-------------------------
set useUnicode to true
put "C:\Documents and Settings\All Users\Documents\Revolution 1.1.1\" & GeneratedLfile into tPath
open file tPath for binary write
write uniDecode (bom() & the unicodeText of field "PreXML", "UTF8") to file tPath
close file tPath
--------------UTF8-----------------------
---------------UTF16-----------------------
open file tPath
read from file tPath until EOF
close file tPath
put it into myVariable
put uniEncode(myVariable,"UTF8") into field "PreXML"
delete file tPath
open file tPath for binary write
write field "PreXML" to file tPath
close file tPath
---------------UTF16-----------------------
end mouseUp
------------------------------------------------
function bom
set useUnicode to true
return numToChar(abs(baseConvert("FEFF",16,10)))
end bom
------------------------------------------------
**Best regards,
**rol4leg
**I use this code to generate my XML file in unicode
**GeneratedLfile is your ".xml" file
**field "PreXML" would be your "field in Cherokee syllabary" which should be written in XML of course
on mouseUp
---------------UTF8-------------------------
set useUnicode to true
put "C:\Documents and Settings\All Users\Documents\Revolution 1.1.1\" & GeneratedLfile into tPath
open file tPath for binary write
write uniDecode (bom() & the unicodeText of field "PreXML", "UTF8") to file tPath
close file tPath
--------------UTF8-----------------------
---------------UTF16-----------------------
open file tPath
read from file tPath until EOF
close file tPath
put it into myVariable
put uniEncode(myVariable,"UTF8") into field "PreXML"
delete file tPath
open file tPath for binary write
write field "PreXML" to file tPath
close file tPath
---------------UTF16-----------------------
end mouseUp
------------------------------------------------
function bom
set useUnicode to true
return numToChar(abs(baseConvert("FEFF",16,10)))
end bom
------------------------------------------------
**Best regards,
**rol4leg
Last edited by rol4leg on Sat Aug 05, 2006 1:03 am, edited 3 times in total.
Re: Need help with unicode and xml
Because of the way UTF-8 is encoded, the XML parsers just might work with that. Try converting your text and see.tsalagi wrote:The problem is, I have one field in Cherokee syllabary (entered directly into my Revolution field), which needs to be saved in the xml file. I have read everything I can find about Rev and unicode, but I can't get anything to work correctly! I get garbage in my xml file every time.