Matlab读取UTF-8编码的中⽂字符
英文在workspace中输⼊⼀下指令代码:
agreewith
currentCharacterEncoding = slCharacterEncoding()
drawn
招聘会计slCharacterEncoding(encoding) %encoding 为设置的具体的编码模式
这两句代码分别为:
1、读取当前编码模式
2、设置所需编码模式
Description
This command allows you to change the current MATLAB® character t encoding to be compatible with the character encoding of a model that you want to open.
currentCharacterEncoding = slCharacterEncoding() returns the current MATLAB character t encoding.
ingersoll
slCharacterEncoding(encoding) changes the MATLAB character t encoding to the specified encoding. You should only specify the values:
'US-ASCII'
'Windows-1252'dateofbirth
'ISO-8859-1'
凯文杜兰特英文'Shift_JIS'
'UTF-8'
If you want to u a different character encoding, you need to start MATLAB with the appropriate locale ttings for your operating system. Consult your operating system manual to change the locale tting. Simulink® can support any character encoding that us single-byte or double-byte characters.
蠢蛋搞怪秀3dIf you open a model that us a particular character t encoding in a MATLAB ssion that us a different encoding, a warning appears. For example, suppo that you create a model in a MATLAB
荒谬的ssion configured for Shift_JIS and open it in a ssion configured for US_ASCII. The warning message shows the encoding of the current ssion and the encoding ud to create the model. If you encounter any problems with corrupted characters, for example when using MATLAB files associated with the model, then try using the function to change the character encoding
1. Clo all open models.
2. U slCharacterEncoding to change the character encoding of the current MATLAB ssion to match the model
accomcharacter encoding.
3. Reopen the model.
Note You must clo all open models or libraries before changing the MATLAB character t encoding except when changing from 'US-ASCII' to another encoding.
来⾃ <>