CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Unicode decode error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2023, 09:29
Default Unicode decode error
  #1
New Member
 
raihan
Join Date: Feb 2015
Posts: 10
Rep Power: 11
rtyme06 is on a distinguished road
Hi, I am trying to compile a UDF but getting the following error:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 414: character maps to <undefined>:
File "Q:\Users\XY\YZ\clear\win64\3ddp_node\SConstru ct", line 176:
generate_udf_source(t,s,env)
File "Q:\Users\XY\YZ\clear\win64\3ddp_node\SConstru ct", line 87:
for line in f:
File "C:\PROGRA~1\ANSYSI~1\v222\fluent/../commonfiles/CPython/3_7/winx64/Release/python\lib\encodings\cp1252.py", line 23:
return codecs.charmap_decode(input,self.errors,decoding_t able)[0]

After googling I found this is related to python and changing the file encoding to UTF-8 might solve the problem.

Here is a link to the stackOverFlow answer:
https://stackoverflow.com/questions/...on-y-character

I am using the built-in solver. I checked the whole file by commenting out most part to see which line is giving me the error. The error is with the whole file.
I have been able to compile other UDFs in the same computer. So my question is how to solve this error in Fluent?

Thank you
rtyme06 is offline   Reply With Quote

Old   January 18, 2023, 10:54
Default Solved!
  #2
New Member
 
raihan
Join Date: Feb 2015
Posts: 10
Rep Power: 11
rtyme06 is on a distinguished road
The encoding can be changed by opening the file in Notepad.

Open file -> Save As -> Change style to ANSI -> Save.

Do not resave in Rich Text Format as suggested by Notepad.
rtyme06 is offline   Reply With Quote

Reply

Tags
charmap, udf compilation, udf compile, unicode


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] blockMesh with double grading. spwater OpenFOAM Meshing & Mesh Conversion 92 January 12, 2019 10:00
[OpenFOAM] Native ParaView Reader Bugs tj22 ParaView 270 January 4, 2016 12:39
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 19:00
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 10:17
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 21:50


All times are GMT -4. The time now is 13:15.