{"record":{"id":"fc996e2c46f9932c","repo":"fish2018/pansou","slug":"s-gbk-w","errorCode":null,"errorMessage":"[%s] GBK 编码搜索关键词失败: %w","messagePattern":"\\[(.+?)\\] GBK 编码搜索关键词失败: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/yulinshufa/yulinshufa.go","lineNumber":170,"sourceCode":"\tresults := p.fetchDetailResults(items)\n\tvalidResults := make([]model.SearchResult, 0, len(results))\n\tfor _, res := range results {\n\t\tif len(res.Links) == 0 {\n\t\t\tp.debugf(\"结果[%s] 无有效链接, 已跳过\", res.UniqueID)\n\t\t\tcontinue\n\t\t}\n\t\tvalidResults = append(validResults, res)\n\t}\n\tp.debugf(\"有效结果数量: %d（原始 %d）\", len(validResults), len(results))\n\n\treturn plugin.FilterResultsByKeyword(validResults, keyword), nil\n}\n\n// fetchSearchItems 请求搜索页面并解析列表\nfunc (p *YulinshufaPlugin) fetchSearchItems(client *http.Client, keyword string) ([]searchItem, error) {\n\tencodedKeyword, err := gbkQueryEscape(keyword)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] GBK 编码搜索关键词失败: %w\", p.Name(), err)\n\t}\n\tsearchURL := fmt.Sprintf(baseURL+searchPath, encodedKeyword)\n\tctx, cancel := context.WithTimeout(context.Background(), requestTimeout)\n\tdefer cancel()\n\tp.debugf(\"请求搜索URL: %s\", searchURL)\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, searchURL, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 创建搜索请求失败: %w\", p.Name(), err)\n\t}\n\tp.decorateCommonHeaders(req)\n\n\tresp, err := p.doRequestWithRetry(client, req, requestMaxRetries)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 搜索请求失败: %w\", p.Name(), err)\n\t}\n\tdefer resp.Body.Close()\n","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/yulinshufa/yulinshufa.go#L152-L188","documentation":"gbkQueryEscape failed to GBK-encode the yulinshufa search keyword. The site requires GBK query encoding; encoding fails for runes unrepresentable in GBK (e.g. emoji or rare characters) or a bad rune in the input.","triggerScenarios":"Thrown at plugin/yulinshufa/yulinshufa.go:170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Sanitize the keyword to GBK-encodable runes","Fall back to UTF-8 escaping or drop the offending characters"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"beaa56133755a548ebc51b090b3816e2ae044aa6","analyzedAt":"2026-09-07T00:31:18.025Z","contentChangedAt":"2026-09-07T00:31:18.025Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}