Skip to content
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

Use UTF-8 instead #24

Merged
merged 2 commits into from
Oct 23, 2015
Merged

Conversation

nabeken
Copy link
Contributor

@nabeken nabeken commented Oct 6, 2015

CloudWatch Logs API can accept UTF-8 but this plugin sets force_encoding('ASCII-8BIT') and it prevents us from sending messages that has valid UTF-8 string.

Changes

  • Use String#encode to encode strings to UTF-8 and set :invalid => :replace to ensure that invalid UTF-8 strings will be replaced and let the plugin continues working
  • Use String#bytesize instead of String#length

@hundt
Copy link
Contributor

hundt commented Oct 13, 2015

👍 I ran into this issue today--the current code not only won't send UTF-8 but raises an exception (and makes the plugin stop working) if any non-ASCII characters are present.

@ryotarai
Copy link
Collaborator

Thank you!

ryotarai added a commit that referenced this pull request Oct 23, 2015
@ryotarai ryotarai merged commit 4082ca1 into fluent-plugins-nursery:master Oct 23, 2015
@ryotarai
Copy link
Collaborator

v0.1.2 released

@cdenneen
Copy link

running 0.4.5 and still seeing this issue

2019-03-27 16:48:01 +0000 [warn]: temporarily failed to flush the buffer. next_retry=2019-03-27 16:47:12 +0000 error_class="Encoding::UndefinedConversionError" error="\"\\xE2\" from ASCII-8BIT to UTF-8" plugin_id="object:2ac8eebb65fc"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants