|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Nov 15, 2007 11:30 pm
[2.11] Pasting Settings with some characters |
It would seem there is some horrible, ludicrous, obnoxious, vile, yucky letter replacement thing that goes on when pasting settings in to the PE. So far I have noted: ≥ becomes =; √, v; ⁿ, n; other like ÷ and ± just fail and nothing gets pasted after it thinks for a while.
1. Launch CMud
2. Close Sessions window (ESC)
3. Open the Package Editor (CTRL-G)
4. Click in the tree panel of the PE
5. Paste (CTRL-V)
Code: |
<?xml version="1.0" encoding="UTF-8" ?>
<cmud>
<func name="delset">
<value>$llist=%concat("÷",%replace($list,"|","÷÷"),"÷")
$lpat=%concat("(÷",%replace($set,"|","÷|÷"),"÷)")
$lret=%leftback(%right(%subregex($llist,$lpat,""),1),1)
#RETURN %replace($lret,"÷÷","|")</value>
<arglist>$set,$list</arglist>
</func>
<func name="issubset" type="Integer">
<value>$llist=%concat("÷",%replace(%dups($list),"|","÷÷"),"÷")
$lpat=%concat("÷",%replace($set,"|","÷|÷"),"÷")
#IF ($exact) {
$lpat=%concat("(?:(?:",$lpat,")(?:(?!",$lpat,")÷.*?÷)*){",%numitems($lpat),"}")
} {
$lpat=%concat("(?:",$lpat,")")
}
#RETURN %regex($llist,$lpat)</value>
<arglist>$set,$list,$exact</arglist>
</func>
<func name="subset" type="StringList">
<value>$lret=""
#FORALL $set {
#IF (%ismember(%i,$list)) {#ADDITEM $lret {%i}}
}
#RETURN $lret</value>
<arglist>$set,$list</arglist>
</func>
</cmud>
|
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Fri Nov 16, 2007 1:55 am |
What keyboard and language is your computer using? (Might be relevant.)
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Nov 16, 2007 4:58 am |
I'm not sure what I'm doing wrong but I got nothing when I do the paste in both CMUD and Pro.
|
|
_________________ Asati di tempari! |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Nov 16, 2007 1:38 pm |
You are not doing anything wrong Tech, the ÷'s cause the whole paste to fail in CMud. I personally find that much worse then having some characters get changed.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Fri Nov 16, 2007 2:16 pm |
This is slightly off-topic, but in 2.11 I'm unable to paste anything in the xml tab. To be more correct, I can paste some text in xml, but if I close-open the editor or click Save Settings - everything gone and previous text get restored. I just thought that these issues may be related...
|
|
_________________ My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Fri Nov 16, 2007 2:23 pm |
Arde, If you search my posts I was having a similar problem a few versions back. My issue was that I had some actual special characters in a few of my scripts.
After I removed the offending values and replaced them with things like %e and %char(11) xml started working for me again. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Fri Nov 16, 2007 4:00 pm |
Arminas
No I have a different problem. I can't paste even the xml for an empty GUI-generated alias. In other words, the editor does not save any single character been entered in xml tab, while accepting data from other tabs. Both in my and in untitled session.
Vijilante
Sorry for drag this thread off. I tried to test your script, but... |
|
_________________ My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Nov 16, 2007 5:53 pm |
XML can be *very* picky about accepting non-standard ascii characters. I think I need to change the encoding value being used, or else there is a bug in the TurboPower XMLPartner code when dealing with UTF-8 characters. But I'll look into this and see if I can get it to work.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Nov 20, 2007 9:44 pm |
OK, the problem with this is that the ÷ character is not a valid UTF-8 character. If I change the first line to
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?> |
Then it works. So I'm tempted to change the XML export to use ISO-8859-1 instead of UTF-8.
But my question is how did you get this XML in the first place? When CMUD exports this, it puts the character within a CDATA field, and that should be fine. Or else it converts the ÷ to a '& divide;' entity. So I'm not sure how CMUD would have generated this XML in the first place. |
|
Last edited by Zugg on Wed Nov 21, 2007 1:59 am; edited 1 time in total |
|
|
|
hogarius Adept
Joined: 29 Jan 2003 Posts: 221 Location: islands.genesismuds.org
|
Posted: Wed Nov 21, 2007 12:45 am |
Zugg, what exactly did you change the first line to?
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Nov 21, 2007 12:50 am |
To get that XML I selected the 3 functions in the tree, then right-clicked and did copy. I then pasted the XML into notepad to change the - character to something more unique. Once done editting I copied then tried to paste the finished functions into another package (left-click in tree panel, CTRL-V) and found it didn't work. I played around with the characters some to find a few of the various conversion, then put it up as a bug report.
I never did anything with XML tab, that was someone else mentioning it. Also I wan not about to muck around replacing them one character at a time. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 21, 2007 1:07 am |
Quote: |
I then pasted the XML into notepad to change the - character to something more unique. |
OK, that explains it then. You changed the - character to a character that isn't supported by the UTF-8 encoding.
Quote: |
Zugg, what exactly did you change the first line to? |
The first line looks like this in v2.13:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?> |
That's the encoding that supports the character that Vijilante was inserting via Notepad. |
|
|
|
hogarius Adept
Joined: 29 Jan 2003 Posts: 221 Location: islands.genesismuds.org
|
Posted: Wed Nov 21, 2007 1:12 am |
<squints>
<sees only web site background in both lines>
<furrows his brow>
. . . |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 21, 2007 2:00 am |
OK, I updated the XML tag in the posts above. So they should show up properly now.
|
|
|
|
|
|