今天爱分享给大家带来我们在 web 应用开发过程中经常遇到输出某种编码的字符,如 iso8859-1 等,如何输出一个某种编码的字符串?【面试题详解】,希望能够帮助到大家。
public String translate (String str) {
String tempStr = "";
try {
tempStr = new String(str.getBytes("ISO-8859-1"), "GBK");
tempStr = tempStr.trim();
}
catch (Exception e) {
System.err.println(e.getMessage());
}
return tempStr;
}
			    						    						    						    					    		
			    					    				    					    			 原文链接:https://blog.itblood.com/2999.html,转载请注明出处。		    			
		            
![火影忍者:被查克拉束缚v0.14 AI版[PC+安卓/1.52G/更新]Naruto:Bound by Chakra [v0.14] [同人SLG/汉化/沙盒]](/wp-content/uploads/replace/2025/08/29/04c1549ae029c627493ca20a3b37466a.webp)