-
Notifications
You must be signed in to change notification settings - Fork 19
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
Output encoding #70
Comments
The primary reason for HashElement et al. was to capture Gyoku's hash syntax is interesting for representing attributes, I could see that working. It would be a significant change to the generated structure, and a breaking change. This library is not very actively developed at the moment, if that's something you're interested in carrying forward then a fork would be the way to go. I'm happy you found this library useful-enough to make constructive suggestions! |
Ox can use document encoding:
<?xml version="1.0" encoding="Windows-1251" ?>
.I want convert this encoding like this
string&.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
But my parsed item is Saxerator::Builder::HashElement
I can't do this way
item.transform_values! { |value| value&.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?') }
because item can contains elements of types: Saxerator::Builder::ArrayElement and Saxerator::Builder::HashElement recursively.
Moreover I must convert encoding for attributes.
So there are 2 ways to resolve this problem.
deep_encode
like https://apidock.com/rails/Hash/deep_mergeP.S. And there is another question. Why we are using this types? Can we simplify like this: https://github.com/savonrb/gyoku
The text was updated successfully, but these errors were encountered: