[PR #5018] [CLOSED] fix utf8 parser error #22182

Closed
opened 2026-04-19 16:08:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/5018
Author: @007gzs
Created: 6/13/2024
Status: Closed

Base: mainHead: patch-1


📝 Commits (2)

📊 Changes

2 files changed (+13 additions, -1 deletions)

View changed files

📝 parser/parser.go (+2 -1)
📝 parser/parser_test.go (+11 -0)

📄 Description

in v0.1.43 when utf8 char in modelfile ,after parse got �������������

test code :

	var Modelfile string = "FROM llama3:70b\nSYSTEM \"\"\"\n提问和回答都使用中文\n\"\"\""
	var sr io.Reader = strings.NewReader(Modelfile)
	f, err := parser.ParseFile(sr)
	fmt.Printf("err: %v\n", err)
	fmt.Printf("f: %v\n", f)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/5018 **Author:** [@007gzs](https://github.com/007gzs) **Created:** 6/13/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (2) - [`08ebacb`](https://github.com/ollama/ollama/commit/08ebacb8c4da4432a85ddf97fde9365bfc47b5b2) fix utf8 parser error - [`d22cec1`](https://github.com/ollama/ollama/commit/d22cec1c1f2eb62b740f64cabd0b658073b78ffe) add utf8 test case ### 📊 Changes **2 files changed** (+13 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `parser/parser.go` (+2 -1) 📝 `parser/parser_test.go` (+11 -0) </details> ### 📄 Description in `v0.1.43` when utf8 char in modelfile ,after parse got `�������������` test code : ``` var Modelfile string = "FROM llama3:70b\nSYSTEM \"\"\"\n提问和回答都使用中文\n\"\"\"" var sr io.Reader = strings.NewReader(Modelfile) f, err := parser.ParseFile(sr) fmt.Printf("err: %v\n", err) fmt.Printf("f: %v\n", f) ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 16:08:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#22182