diff --git a/python/ycm/completers/cpp/flags.py b/python/ycm/completers/cpp/flags.py index 10db27e9..c2e4377f 100644 --- a/python/ycm/completers/cpp/flags.py +++ b/python/ycm/completers/cpp/flags.py @@ -103,6 +103,7 @@ class Flags( object ): def _CallExtraConfFlagsForFile( module, filename, client_data ): + filename = ToUtf8IfNeeded( filename ) # For the sake of backwards compatibility, we need to first check whether the # FlagsForFile function in the extra conf module even allows keyword args. if inspect.getargspec( module.FlagsForFile ).keywords: diff --git a/python/ycm/completers/general/filename_completer.py b/python/ycm/completers/general/filename_completer.py index e4d56915..350f0890 100644 --- a/python/ycm/completers/general/filename_completer.py +++ b/python/ycm/completers/general/filename_completer.py @@ -22,6 +22,7 @@ import re from ycm.completers.completer import Completer from ycm.completers.cpp.clang_completer import InCFamilyFile from ycm.completers.cpp.flags import Flags +from ycm.utils import ToUtf8IfNeeded from ycm.server import responses class FilenameCompleter( Completer ): @@ -55,7 +56,7 @@ class FilenameCompleter( Completer ): def AtIncludeStatementStart( self, request_data ): start_column = request_data[ 'start_column' ] current_line = request_data[ 'line_value' ] - filepath = request_data[ 'filepath' ] + filepath = ToUtf8IfNeeded( request_data[ 'filepath' ] ) filetypes = request_data[ 'file_data' ][ filepath ][ 'filetypes' ] return ( InCFamilyFile( filetypes ) and self._include_start_regex.match( @@ -76,7 +77,7 @@ class FilenameCompleter( Completer ): def ComputeCandidatesInner( self, request_data ): current_line = request_data[ 'line_value' ] start_column = request_data[ 'start_column' ] - filepath = request_data[ 'filepath' ] + filepath = ToUtf8IfNeeded( request_data[ 'filepath' ] ) filetypes = request_data[ 'file_data' ][ filepath ][ 'filetypes' ] line = current_line[ :start_column ]