-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The latest version eats ampersands for some reason #100
Comments
I'm not experiencing problems with ampersands. BTW it's not necessary to set MSH_2 if you use the default one, it is already set by the module. That said, if I do m = Message("RSP_K21")
m.msh.msh_2 = '^~\\&'
print(repr(m.to_er7())) I correctly get:
Please, be more specific. If you can, provide an example, thanks |
For me right at that point of assigning the value, to f, I'm having the same issue in the segment MSH_3 and component HD_1. Basically it seems you can only add & if and only if you add it the child traversal way. |
Very strange behavior you've discovered :) I tried changing MSH.3 and I don't have any problem. m = Messasge()
m.msh.msh_3 = "try&p&rs&nd"
print(repr(m.to_er7()) I get Hope that solves your issue |
Yeah, I wasn't trying to delete it originally, but when I validated it, I was getting extra MSH segments.
In the end I made a dictionary that each key's value so it calls a function that populates the proper segments. |
``
I think the ampersand is broken in the thing.value= method of assignation. c.value='\&' or anything with an '&' truncates or nulls the actual text value.
Gives me a None type error. |
I still cannot reproduce the error. c = Component("HD_1")
>>> c.value = "Children & fmaily"
>>> c.value
'Children & family'
>>> c.value = "\&"
>>> c.value
'\\E\\&' which is correct.
|
For example, setting MSH_2='^
&' or '^\&' or any combination of slashes or even hard-coding the character with the unicode character number, the ampersand refused to be there. Using u' strings also doesn't work.Printing the message, any and all ampersands are gone.
And even more, if you have another element with an ampersand in it, the whole thing becomes a None type.
This is the last thing remaining on my project is getting the & to print in a message =/
The text was updated successfully, but these errors were encountered: