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

"\xEF\xBB\xBF" error (on Windows) #224

Closed
suriyaa opened this issue Nov 24, 2015 · 3 comments · Fixed by #225
Closed

"\xEF\xBB\xBF" error (on Windows) #224

suriyaa opened this issue Nov 24, 2015 · 3 comments · Fixed by #225

Comments

@suriyaa
Copy link

suriyaa commented Nov 24, 2015

@bkeepers @phlipper @shingara @metavida @Floppy:

Hi guys, 😄

I got an "\xEF\xBB\xBF" error for dotenv while using the basics-of-authentication project from GitHub:

C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/parser.rb:61:in `parse_line':
Line "\xEF\xBB\xBFGH_BASIC_CLIENT_ID=1234567890" doesn't match format (Dotenv::FormatError)

from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/parser.rb:45:in `block in call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/parser.rb:44:in `each'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/parser.rb:44:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/parser.rb:34:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/environment.rb:13:in `load'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/environment.rb:9:in `initialize'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:15:in `new'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:15:in `block (2 levels) in load'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:59:in `ignoring_nonexistent_files'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:14:in `block in load'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:46:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:46:in `block in with'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:45:in `each'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:45:in `reduce'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:45:in `with'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:13:in `load'
from advanced_server.rb:6:in `<main>'

This error is occurring at dotenv-2.0.2/lib/dotenv/parser.rb on my Windows 10.

What's the problem?

Read also the important issue on github/platform-samples#78!

Yours,
Suriyaa Kudo :octocat:

@suriyaa suriyaa changed the title "\xEF\xBB\xBF" error "\xEF\xBB\xBF" error (on Windows) Nov 24, 2015
@suriyaa
Copy link
Author

suriyaa commented Nov 26, 2015

I found out that the _\xef\xbb\xbf error_ contains probably invisible junk characters (at least from dotenv's perspective) called the Unicode BOM (short name for: _byte order mark__)_.

This project thinks that those characters are part of the command that follows right after.

This is what I can see this message in the log, though the characters are escaped so they're visible to the naked eye: Line "\xEF\xBB\xBFGH_BASIC_CLIENT_ID=1234567890" doesn't match format (Dotenv::FormatError)!

(adapted from http://stackoverflow.com/a/5373369/5157221)

How can I repair the rest of the error warning?

@metavida
Copy link
Contributor

Agreed with your research. The solutions I've seen involve either telling your text editor to not add the BOM character (either via a preference or by saving the file as ASCII instead of UTF-8) or by using an editor that doesn't insert the BOM character (I saw one post recommend Notepad++)

@suriyaa
Copy link
Author

suriyaa commented Nov 29, 2015

@metavida: I use the Windows Editor but it also doesn't work with Notepad++. 😧

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 a pull request may close this issue.

2 participants