{"record":{"id":"e925d86f2e644cdb","repo":"rouge-ruby/rouge","slug":"bad-encoding-str-encoding-names-join-ple","errorCode":null,"errorMessage":"Bad encoding: #{str.encoding.names.join(',')}. Please convert your string to UTF-8.","messagePattern":"Bad encoding: #(.+?)\\. Please convert your string to UTF-8\\.","errorType":"exception","errorClass":"EncodingError","httpStatus":null,"severity":"error","filePath":"lib/rouge/lexer.rb","lineNumber":328,"sourceCode":"        (@filenames ||= []).concat(fnames)\n      end\n\n      # Specify a list of mimetypes associated with this lexer.\n      #\n      # @example\n      #   class Html < Lexer\n      #     mimetypes 'text/html', 'application/xhtml+xml'\n      #   end\n      def mimetypes(*mts)\n        (@mimetypes ||= []).concat(mts)\n      end\n\n      # @private\n      def assert_utf8!(str)\n        encoding = str.encoding\n        return if encoding == Encoding::US_ASCII || encoding == Encoding::UTF_8 || encoding == Encoding::BINARY\n\n        raise EncodingError.new(\n          \"Bad encoding: #{str.encoding.names.join(',')}. \" +\n          \"Please convert your string to UTF-8.\"\n        )\n      end\n\n    private\n      def registry\n        @registry ||= {}\n      end\n    end\n\n    # -*- instance methods -*- #\n\n    attr_reader :options\n    # Create a new lexer with the given options.  Individual lexers may\n    # specify extra options.  The only current globally accepted option\n    # is `:debug`.\n    #","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/rouge-ruby/rouge/blob/bd7dad7b0939c556e582a0370686f6fc022c8af5/lib/rouge/lexer.rb#L310-L346","documentation":"Error \"Bad encoding: #{str.encoding.names.join(',')}. Please convert your string to UTF-8.\" thrown in rouge-ruby/rouge.","triggerScenarios":"Thrown at lib/rouge/lexer.rb:328 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bd7dad7b0939c556e582a0370686f6fc022c8af5","analyzedAt":"2026-08-23T11:34:50.713Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}