#153791 - sgeos - Sun Apr 06, 2008 9:47 am
This is more of an encoding problem than a coding problem, but the two are related.
In any case, assume I have a message such as:
Clearly dealing with newlines and formfeeds is simple.
ASCII has special characters for this.
The problem is that other magic cookies need to inserted in the code.
<party> is a fairly simple inline function that takes one parameter.
It finds the party member at the Nth position and returns their name.
In order to get this to work, some sort of magic cookie needs to inlined in the message.
If I could assume ASCII, I would probably use 0xFF or something to that effect, but I'm going to assume unicode at this point.
Does anyone know of any magic cookie values that are unicode compatible?
Multibyte values are fine.
The data will be inlined as such:
Cookie Bytes, Function Indicator Bytes, Function Parameter Bytes
Note that <choice> requires a bunch of cookies- one to start it, one for each choice, and one to end it. This does not change the problem.
-Brendan
EDIT: Using end-user defined characters, although the obvious solutions, seems like the easy way out. I'm hoping that someone else has run into this or a similar problem and knows of an existing character code or value that makes sense as a cookie indicator.
In any case, assume I have a message such as:
Code: |
Who is your leader?<nl><choice:<party:0> <party:1> <party:2>><ff>
Do you come in peach?<nl><choice::yes :no :silence><ff> Please wait a minute. |
Clearly dealing with newlines and formfeeds is simple.
ASCII has special characters for this.
The problem is that other magic cookies need to inserted in the code.
<party> is a fairly simple inline function that takes one parameter.
It finds the party member at the Nth position and returns their name.
In order to get this to work, some sort of magic cookie needs to inlined in the message.
If I could assume ASCII, I would probably use 0xFF or something to that effect, but I'm going to assume unicode at this point.
Does anyone know of any magic cookie values that are unicode compatible?
Multibyte values are fine.
The data will be inlined as such:
Cookie Bytes, Function Indicator Bytes, Function Parameter Bytes
Note that <choice> requires a bunch of cookies- one to start it, one for each choice, and one to end it. This does not change the problem.
-Brendan
EDIT: Using end-user defined characters, although the obvious solutions, seems like the easy way out. I'm hoping that someone else has run into this or a similar problem and knows of an existing character code or value that makes sense as a cookie indicator.