Describe the problem/error/question
Hello,
Short version:
I’m experiencing intermittent character encoding issues with Gemini API where Turkish characters get corrupted to Chinese characters.
Long version:
I have an agent that performs real-time analysis of videos uploaded to specific YouTube channels. I send the video link and some instructions along with the prompt to the following endpoint (Gemini API):
https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent
It had been working without issues for a long time. However, I started getting an error like the one below with Gemini 2.5 Pro. I then switched to Gemini 3 Pro thinking it was a model-related issue, but the error persists. From what I understand, there’s a problem related to Turkish characters and UTF-8.
And the problem doesn’t happen with all requests. Some of them returns an unreadable text. I would really appreciate it if you could help.
I always update to the latest version of n8n cloud. This problem seems to be a Gemini endpoint issue but I wanted to be sure if there is any Http Request Node issues out there after the latest updates.
What is the error message (if any)?
The Prompt that I use:
**return {
contents: [
{
role: “user”,
parts: [
{
fileData: {
mimeType: “video/*”,
fileUri: $input.first().json.videoUrl
}
},
{
text: `This is a long prompt so I removed it`
}
]
}
],
generationConfig: {
responseMimeType: “text/plain”
}
};
This is what I get from Gemini (http request):
AJet鈥檌n yurt d谋艧谋 u莽u艧lar谋 i莽in g眉ncellenen bagaj prosed眉rlerini, limitlerini ve bilet segmentlerine g枚re (Basic, EcoJet, Flex, Premium) de臒i艧en bagaj haklar谋n谋 yolculara net bir 艧ekilde 枚臒retmek.\n\n**RTB:**\nK眉莽眉k 莽anta, kabin bagaj谋 ve kay谋tl谋 bagaj i莽in sunulan kesin 枚l莽眉ler (cm), a臒谋rl谋k limitleri (kg) ve bilet paketlerinin kapsam谋n谋 g枚steren detayl谋 kar艧谋la艧t谋rma tablosu.
Please share your workflow
{
"nodes": [
{
"parameters": {
"method": "POST",
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"contentType": "raw",
"rawContentType": "application/json",
"body": "={{$json}}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1840,
128
],
"id": "18c9d131-a7e9-4ced-a68e-bad123b032e9",
"name": "HTTP Request2",
"retryOnFail": true,
"waitBetweenTries": 4000,
"onError": "continueRegularOutput"
},
{
"parameters": {
"jsCode": "return {\n contents: [\n {\n role: \"user\",\n parts: [\n {\n fileData: {\n mimeType: \"video/*\",\n fileUri: $input.first().json.videoUrl\n }\n },\n {\n text: `Bir reklam ajansında çalışan kıdemli bir stratejik planl...
//This is a long prompt so I removed it//
\n`\n }\n ]\n }\n ],\n generationConfig: {\n responseMimeType: \"text/plain\"\n }\n};"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1632,
128
],
"id": "d61aa65d-823f-4795-b892-f258c28994c4",
"name": "Code6"
}
],
"connections": {
"HTTP Request2": {
"main": [
[],
[]
]
},
"Code6": {
"main": [
[
{
"node": "HTTP Request2",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "removed the id"
}
}
Share the output returned by the last node
Example 1: Corrupted Response
{
“candidates”: [
{
“content”: {
“parts”: [
{
“text”: “Stratejik Mesaj:\nAJet鈥檌n yurt d谋艧谋 u莽u艧lar谋 i莽in g眉ncellenen bagaj prosed眉rlerini…”
}
]
}
}
]
}
Decoded Text (corrupted):
“AJet’in yurt d谋艧谋 u莽u艧lar谋 i莽in g眉ncellenen bagaj prosed眉rlerini..”
Expected Text:
“AJet’in yurt dışı uçuşları için güncellenen bagaj prosedürlerini…”
Information on your n8n setup
- n8n version: 1.123.5
- Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
- Operating system: mac Tahoe 26.1