2

I am using ruby 2.5 and supporting for foreign chars I am using..

NLS_LANG'] ||= 'AMERICAN_AMERICA.UTF8 

In ROR application. But facing issue with special chars in file name.

Here is the Problem statement.

  1. Generating the files using ruby rake
  2. Files are getting generated on Linux server
  3. Files are having special chars and those looking fine in linux server.
  4. Now I am fetching these files from Window server using scp command,

but When I see these reports in Window server, foreign chars are not supported in file names.

Any suggestion on This.

I have tried below options:-

file_name = file_name.encode("ISO-8859-1")
file_name = file_name.encode("UTF-8")

Iconv.conv('Windows-1252', 'UTF-8', file_name)


file_name.encode!("windows-1252", :invalid => :replace, :undef => :replace, :replace => "?")

I am not sure about this issue is server level or application level.

Help will be appreciated.

Sudhir
  • 146
  • 1
  • 4
  • Please fix your first code example as it is invalid syntax. Please be clear and specific about what operating system is having problems (specify what operating system is attempting to write the files). If you're trying to write these files on Windows, and if you are trying to replace invalid characters with `?` then [that will fail](https://stackoverflow.com/q/1976007/3784008). – anothermh Dec 27 '18 at 00:01

0 Answers0