Fix Hebrew file names reading
#1
In MUI Hebrew XBMC could not read Hebrew file names.
I found the bug and fixed it.
I would be happy to Commit it - Actually very small default parameter not initialized.

The problem I do not have permission
What user name / password should I use?

David.
Reply
#2
Hi there and welcome!

Thanks a lot for finding a bug and fixing it as well Smile

Post a ticket to trac (http://trac.xbmc.org) using your forum username and password (case sensitive).

We'll review and commit as required.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Index: guilib/GUITextLayout.cpp
===================================================================
--- guilib/GUITextLayout.cpp (revision 15893)
+++ guilib/GUITextLayout.cpp (working copy)
@@ -520,7 +520,7 @@
utf32.push_back(utf16[i] | colStyle);
}

-void CGUITextLayout::utf8ToW(const CStdString &utf8, CStdStringW &utf16)
+void CGUITextLayout::utf8ToW(const CStdString &utf8, CStdStringW &utf16, bool bVisualBiDiFlip/*=true*/)
{
#ifdef WORK_AROUND_NEEDED_FOR_LINE_BREAKS
// NOTE: This appears to strip \n characters from text. This may be a consequence of incorrect
@@ -531,13 +531,13 @@
for (unsigned int i = 0; i < multiLines.size(); i++)
{
CStdStringW line;
- g_charsetConverter.utf8ToW(multiLines[i], line);
+ g_charsetConverter.utf8ToW(multiLines[i], line, bVisualBiDiFlip);
utf16 += line;
if (i < multiLines.size() - 1)
utf16.push_back(L'\n');
}
#else
- g_charsetConverter.utf8ToW(utf8, utf16);
+ g_charsetConverter.utf8ToW(utf8, utf16, bVisualBiDiFlip);
#endif
}

Index: guilib/GUITextLayout.h
===================================================================
--- guilib/GUITextLayout.h (revision 15893)
+++ guilib/GUITextLayout.h (working copy)
@@ -99,6 +99,6 @@
static void DrawOutlineText(CGUIFont *font, float x, float y, const std::vector<DWORD> &colors, DWORD outlineColor, DWORD outlineWidth, const std::vector<DWORD> &text, DWORD align, float maxWidth);
static void ParseText(const CStdStringW &text, DWORD defaultStyle, std::vector<DWORD> &colors, std::vector<DWORD> &parsedText);

- static void utf8ToW(const CStdString &utf8, CStdStringW &utf16);
+ static void utf8ToW(const CStdString &utf8, CStdStringW &utf16, bool bVisualBiDiFlip=true);
};

Index: guilib/TextureBundle.cpp
===================================================================
--- guilib/TextureBundle.cpp (revision 15893)
+++ guilib/TextureBundle.cpp (working copy)
@@ -142,7 +142,7 @@

#ifndef _LINUX
CStdStringW strPathW;
- g_charsetConverter.utf8ToW(strPath, strPathW);
+ g_charsetConverter.utf8ToW(strPath, strPathW,false);
if (GetFileAttributesW(strPathW.c_str()) == -1)
return false;

Index: xbmc/Application.cpp
===================================================================
--- xbmc/Application.cpp (revision 15893)
+++ xbmc/Application.cpp (working copy)
@@ -510,8 +510,8 @@
srcFile.append(file);
#ifdef _WIN32PC
CStdStringW srcFileW,strPathW;
- g_charsetConverter.utf8ToW(srcFile,srcFileW);
- g_charsetConverter.utf8ToW(strPath,strPathW);
+ g_charsetConverter.utf8ToW(srcFile,srcFileW,false);
+ g_charsetConverter.utf8ToW(strPath,strPathW,false);
CopyFileW(srcFileW, strPathW, TRUE);
#else
CopyFile(srcFile.c_str(), strPath.c_str(), TRUE);
Index: xbmc/FileSystem/cddb.cpp
===================================================================
--- xbmc/FileSystem/cddb.cpp (revision 15893)
+++ xbmc/FileSystem/cddb.cpp (working copy)
@@ -189,7 +189,7 @@

//##########################################################
// Read the data from cddb
- Recv(false); //erstmal den Mll abholen
+ Recv(false); //erstmal den M ll abholen
if ( !Send(read_buffer) )
{
CLog::Log(LOGERROR, "Xcddb::queryCDinfo_inexaxt_list_select Error sending \"%s\"", read_buffer.c_str());
Index: xbmc/FileSystem/FileHD.cpp
===================================================================
--- xbmc/FileSystem/FileHD.cpp (revision 15893)
+++ xbmc/FileSystem/FileHD.cpp (working copy)
@@ -81,7 +81,7 @@

#ifdef _WIN32PC
CStdStringW strWFile;
- g_charsetConverter.utf8ToW(strFile,strWFile);
+ g_charsetConverter.utf8ToW(strFile,strWFile,false);
m_hFile.attach(CreateFileW(strWFile.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL));
#else
m_hFile.attach(CreateFile(strFile.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL));
@@ -101,7 +101,7 @@

#ifdef _WIN32PC
CStdStringW strWFile;
- g_charsetConverter.utf8ToW(strFile,strWFile);
+ g_charsetConverter.utf8ToW(strFile,strWFile,false);
return (_wstat64(strWFile.c_str(), &buffer)==0);
#else
return (_stat64(strFile.c_str(), &buffer)==0);
@@ -127,7 +127,7 @@

#ifdef _WIN32PC
CStdStringW strWFile;
- g_charsetConverter.utf8ToW(strFile,strWFile);
+ g_charsetConverter.utf8ToW(strFile,strWFile,false);
return _wstat64(strWFile.c_str(), buffer);
#else
return _stat64(strFile.c_str(), buffer);
@@ -153,7 +153,7 @@

#ifdef _WIN32PC
CStdStringW strWPath;
- g_charsetConverter.utf8ToW(strPath,strWPath);
+ g_charsetConverter.utf8ToW(strPath,strWPath,false);
m_hFile.attach(CreateFileW(strWPath.c_str(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, bOverWrite ? CREATE_ALWAYS : OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL));
#else
m_hFile.attach(CreateFile(strPath.c_str(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, bOverWrite ? CREATE_ALWAYS : OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL));
@@ -260,7 +260,7 @@

#ifdef _WIN32PC
CStdStringW strWFile;
- g_charsetConverter.utf8ToW(strFile,strWFile);
+ g_charsetConverter.utf8ToW(strFile,strWFile,false);
return :Big GrineleteFileW(strWFile.c_str()) ? true : false;
#else
return :Big GrineleteFile(strFile.c_str()) ? true : false;
@@ -275,8 +275,8 @@
#ifdef _WIN32PC
CStdStringW strWFile;
CStdStringW strWNewFile;
- g_charsetConverter.utf8ToW(strFile,strWFile);
- g_charsetConverter.utf8ToW(strNewFile,strWNewFile);
+ g_charsetConverter.utf8ToW(strFile,strWFile,false);
+ g_charsetConverter.utf8ToW(strNewFile,strWNewFile,false);
return ::MoveFileW(strWFile.c_str(), strWNewFile.c_str()) ? true : false;
#else
return ::MoveFile(strFile.c_str(), strNewFile.c_str()) ? true : false;
Index: xbmc/FileSystem/HDDirectory.cpp
===================================================================
--- xbmc/FileSystem/HDDirectory.cpp (revision 15893)
+++ xbmc/FileSystem/HDDirectory.cpp (working copy)
@@ -86,7 +86,7 @@

#ifndef _LINUX
CStdStringW strSearchMask;
- g_charsetConverter.utf8ToW(strRoot,strSearchMask);
+ g_charsetConverter.utf8ToW(strRoot,strSearchMask,false);
strSearchMask += "*.*";
#else
CStdString strSearchMask = strRoot;
@@ -183,7 +183,7 @@

#ifndef _LINUX
CStdStringW strWPath1;
- g_charsetConverter.utf8ToW(strPath1, strWPath1);
+ g_charsetConverter.utf8ToW(strPath1, strWPath1,false);
if(::CreateDirectoryW(strWPath1, NULL))
#else
if(::CreateDirectory(strPath1.c_str(), NULL))
@@ -199,7 +199,7 @@
{
#ifndef _LINUX
CStdStringW strWPath;
- g_charsetConverter.utf8ToW(strPath, strWPath);
+ g_charsetConverter.utf8ToW(strPath, strWPath,false);
return ::RemoveDirectoryW(strWPath) ? true : false;
#else
return ::RemoveDirectory(strPath) ? true : false;
@@ -214,7 +214,7 @@
strReplaced.Replace("/","\\");
if (!CUtil::HasSlashAtEnd(strReplaced))
strReplaced += '\\';
- g_charsetConverter.utf8ToW(strReplaced, strWReplaced);
+ g_charsetConverter.utf8ToW(strReplaced, strWReplaced,false);
DWORD attributes = GetFileAttributesW(strWReplaced);
#else
DWORD attributes = GetFileAttributes(strReplaced.c_str());
Index: xbmc/lib/libcdio/cd_types.h
===================================================================
--- xbmc/lib/libcdio/cd_types.h (revision 15893)
+++ xbmc/lib/libcdio/cd_types.h (working copy)
@@ -3,7 +3,7 @@

Copyright © 2003, 2006 Rocky Bernstein <[email protected]>
Copyright © 1996,1997,1998 Gerd Knorr <[email protected]>
- and Heiko Eifeldt <[email protected]>
+ and Heiko Ei feldt <[email protected]>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -166,7 +166,6 @@
extern cdio_fs_t debug_cdio_fs;

#endif /* __CDIO_CD_TYPES_H__ */
-
/*
* Local variables:
* c-file-style: "gnu"
Index: xbmc/utils/log.cpp
===================================================================
--- xbmc/utils/log.cpp (revision 15893)
+++ xbmc/utils/log.cpp (working copy)
@@ -72,8 +72,8 @@

#ifndef _LINUX
CStdStringW strLogFileW, strLogFileOldW;
- g_charsetConverter.utf8ToW(strLogFile,strLogFileW);
- g_charsetConverter.utf8ToW(strLogFileOld,strLogFileOldW);
+ g_charsetConverter.utf8ToW(strLogFile,strLogFileW,false);
+ g_charsetConverter.utf8ToW(strLogFileOld,strLogFileOldW,false);
:Big GrineleteFileW(strLogFileOldW.c_str());
::MoveFileW(strLogFileW.c_str(), strLogFileOldW.c_str());
#else
Reply
#4
Please post it to trac - this allows us to download the diff and check it without the forum mangling it.

Thanks,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
http://trac.xbmc.org/attachment/ticket/5217/XBMC.exe
just replace the exe after normal installation

enjoy.
David.
Reply
#6
Thanks - I shall make some comments on the trac report.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
Thumbs Up 
thank you david ...i try it and its wrok great!!!!!
Reply
#8
Happy I could Help.
David.
Reply
#9
Please respond to my queries in the trac ticket.

EDIT: Ah - you already did - sorry, I must have missed the mailing!

Thanks,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
The mailing did not work for me too.
I had to enter my ticket to see your questions.

... could the forum administrators look in to it?
Reply
#11
thanks for this fix - works perfectly in beta2, does it still needed for the 8.10 release?
Reply
#12
afaik it's already included. But please try.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#13
i tryied - it's working with 8.10, have another issue thou - movie info in hebrew is alligned to the left and not to the right. Any way to fix that? thanks a lot
Reply

Logout Mark Read Team Forum Stats Members Help
Fix Hebrew file names reading0