Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to fix SkillDescription for utf-8 #375

Open
nusilencer opened this issue Mar 9, 2024 · 2 comments
Open

how to fix SkillDescription for utf-8 #375

nusilencer opened this issue Mar 9, 2024 · 2 comments
Labels
Enhancement Well, pretty much everything is an enhancement. isn't it? (Not essential improvements)

Comments

@nusilencer
Copy link

how to fix SkillDescription for utf-8
I try convort to utf-8
but it read INSI only
skilldesctable.txt

image
skill thai

@nusilencer nusilencer added the Enhancement Well, pretty much everything is an enhancement. isn't it? (Not essential improvements) label Mar 9, 2024
@MrAntares
Copy link
Owner

What is your langtype set to in roBrowser Config?
You can set it to 240 to make it UTF-8 compatible, but be aware that this breaks desktop clients since they don't support it, only the predefined langtypes:
image
If you want to use roBrowser and desktop clients as well, then you need to choose a langtype from one of the listed ones.

@MrAntares
Copy link
Owner

For reference, these are the encodings for each langtype in roBrowser:

		switch (Session.LangType) {
			case 0x00: // SERVICETYPE_KOREA
				if (Configs.get('disableKorean')) {
					charset = 'windows-1250';
					break;
				}

				console.warn('%c[Warning] You are using a Korean langtype. If you have some charset ' +
				             'problem set ROConfig.servers[<index>].disableKorean to true or use a proper langtype !',
				             'font-weight:bold; color:red; font-size:14px');

				charset = 'windows-949';
				break;

			case 0x01: // SERVICETYPE_AMERICA
				charset = 'windows-1252';
				break;
				
			case 0x02: // SERVICETYPE_JAPAN
				charset = 'shift-jis';
				break;

			case 0x03: // SERVICETYPE_CHINA
				charset = 'gbk';
				break;

			case 0x04: // SERVICETYPE_TAIWAN
				charset = 'big5';
				break;

			case 0x05: // SERVICETYPE_THAI
				charset = 'windows-874';
				break;
				
			case 0x06: // SERVICETYPE_INDONESIA
			case 0x07: // SERVICETYPE_PHILIPPINE
			case 0x08: // SERVICETYPE_MALAYSIA
			case 0x09: // SERVICETYPE_SINGAPORE
			case 0x0a: // SERVICETYPE_GERMANY
			case 0x0b: // SERVICETYPE_INDIA
			case 0x0c: // SERVICETYPE_BRAZIL
			case 0x0d: // SERVICETYPE_AUSTRALIA
				charset = 'windows-1252';
				break;

			case 0x0e: // SERVICETYPE_RUSSIA
				charset = 'windows-1251';
				break;

			case 0x0f: // SERVICETYPE_VIETNAM
				charset = 'windows-1258';
				break;

			// Not supported by the encoder/decoder, default to windows-1252
			//case 0x11: // SERVICETYPE_CHILE
			//	charset = 'windows-1145';
			//	break;
			
			case 0x12: // SERVICETYPE_FRANCE
				charset = 'windows-1252';
				break;

			case 0x13: // SERVICETYPE_UAE
				charset = 'windows-1256';
				break;
		
			/////////////////////////////////////////////////////
			// CUSTOM TYPES                                    //
			// Only use them if you know what you are doing ;) //
			/////////////////////////////////////////////////////
			case 0xa0: // 160 - Central European
				charset = 'windows-1250';
				break;
				
			case 0xa1: // 161 - Greek
				charset = 'windows-1253';
				break;
				
			case 0xa2: // 162 - Tukish
				charset = 'windows-1254';
				break;
				
			case 0xa3: // 163 - Hebrew
				charset = 'windows-1255';
				break;
				
			case 0xa4: // 164 - Estonian, Latvian, Lithuaninan
				charset = 'windows-1257';
				break;
			
			/////////////////////////////////////////////////////
			// Custom unicode types                            //
			// Only use them if you know what you are doing ;) //
			/////////////////////////////////////////////////////
			case 0xf0: // 240 - UTF-8
				charset = 'utf-8';
				break;
			case 0xf1: // 241 - UTF-16LE
				charset = 'utf-16le';
				break;
			case 0xf2: // 242 - UTF-16BE
				charset = 'utf-16be';
				break;
			
			default: // Latin1
				charset = 'windows-1252';
				break;
		}

As you can see many of the asian langtypes use widnows-1252, which might not be the right encoding, but this is how the desktop client does it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Well, pretty much everything is an enhancement. isn't it? (Not essential improvements)
Projects
None yet
Development

No branches or pull requests

2 participants