[haiku-commits] Change in haiku[master]: StyledText translator: use a larger buffer for encoding detection

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 9 May 2020 15:14:14 +0000

From Adrien Destugues <pulkomandy@xxxxxxxxx>:

Adrien Destugues has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2628 ;)


Change subject: StyledText translator: use a larger buffer for encoding 
detection
......................................................................

StyledText translator: use a larger buffer for encoding detection

It may be the case that a file is largely ASCII with few UTF-8 or
similar characters (typically, english text mentionning names in other
languages). It turns out 2 kilobytes of text is not enough for a safe
guess in that case.

Fixes #14674
---
M src/add-ons/translators/stxt/STXTTranslator.cpp
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/28/2628/1

diff --git a/src/add-ons/translators/stxt/STXTTranslator.cpp 
b/src/add-ons/translators/stxt/STXTTranslator.cpp
index eeb4e39..7a8f82c 100644
--- a/src/add-ons/translators/stxt/STXTTranslator.cpp
+++ b/src/add-ons/translators/stxt/STXTTranslator.cpp
@@ -33,7 +33,7 @@
 #define B_TRANSLATION_CONTEXT "STXTTranslator"

 #define READ_BUFFER_SIZE 32768
-#define DATA_BUFFER_SIZE 2048
+#define DATA_BUFFER_SIZE 8192

 // The input formats that this translator supports.
 static const translation_format sInputFormats[] = {

--
To view, visit https://review.haiku-os.org/c/haiku/+/2628
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: Id894bebb821c22a17b776a71822d011abc795dea
Gerrit-Change-Number: 2628
Gerrit-PatchSet: 1
Gerrit-Owner: Adrien Destugues <pulkomandy@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: StyledText translator: use a larger buffer for encoding detection - Gerrit